[Grace-core] Inconsistent declaration syntax

James Noble kjx at ecs.vuw.ac.nz
Sun Aug 5 21:41:42 PDT 2012


> re both plausible syntaxes for type definitions.   I liked having a different keyword because the syntax of the right hand sides are quite different.   On the other hand if we wish to be able to use "anonymous" types, then a syntax like the second is reasonable.  Do we want to allow
> 	method m(x: type{m:...,n:...},...) {...}

I think my combinator  parser / grammar allows {..} in a *type* context (ie. after a :) to represent a type.
In expression contexts you need to write "type {..}" to get to a type context.

Having types as defs make clear that e.g. you can do all sort of first-class things with types, e.g. methods returning types :-)

and also raises the question: what type is x in "def x"?   (in fact, the existing pattern reification has most of those issues anyway)

for cultural reasons I seem loth to switch syntax here, even though we should try & do a review before the next release.


getting inheritance sorted,  types, modules, annotations  are higher priorities for me though

James


More information about the Grace-core mailing list