[Grace-core] [Minigrace] type issues in minigrace

Andrew P Black black at cs.pdx.edu
Fri May 25 20:31:08 PDT 2012


On 25 May 2012, at 18:56, Michael Homer wrote:
>> 
>> 
>> type T = {Number->Number}
>> ...
> More than that - it's actually a perfectly valid type, to which this
> object belongs:
>  object {
>    method Number -> Number { 1 }
>  }

I recall discussing, at some pint n the distant past, whether we should encircle case conventions.  Like method names must begin with a lower case letter.   If we want students to do stuff like that, it's probably better to enforce it.

>> type T = {apply: Number->Number}
>> 
> The runtime error is because the type has three viable method names in
> a row ("apply", ":", and "Number"), 

Is : a valid method name?  I thug that it was reserved to mean "here comes a type annotation".   Is it really wise to try and use it for both purposes?  

We might use :: for types, and leave a single : to be an operator, or vice-versa, but I don't thin that we should allow : to play both roles.

	Andrew



More information about the Grace-core mailing list