[Grace-core] On Gradual Typing

Timothy Jones Timothy.Jones at ecs.vuw.ac.nz
Wed Jul 24 19:13:35 PDT 2013


On 25/07, Michael Homer wrote:
> He apparently also has an answer to the question I had about blocks,
> but I don't remember what it is. I think the general sense is that
> extra arguments to blocks shouldn't be permitted. The static typing
> I'm not sure about, but it is clear enough in the usual cases.

I believe the agreement was that blocks accept exactly the same number of
arguments as parameters they define, but there's nothing stopping you writing
something like this (ignoring block generics):

> method maybeApply5(bl : Block0 | Block1) {
>     match(bl)
>         case { Block0 -> bl.apply }
>         case { Block1 -> bl.apply(5) }
> }

-- 
Tim


More information about the Grace-core mailing list