[Grace-core] Precedence of multi-part method names

James Noble kjx at ecs.vuw.ac.nz
Fri May 27 17:59:30 PDT 2011


> There are some more pathological cases as well, especially in the
> "looks like mixfix" line. Something like "f g h i" is arguably legal,
> meaning f(g(h(i))), but it's ambiguous with f(g)h(i) (and wouldn't be
> bad to ban in any case).

yep. the smalltalk syntax - which seems somewhat cleaner than Grace now, 
although I was hoping that wouldn't happen - has ambiguous cases

a b: c d: e 

could be parsed as   a.b(c) d(e)    - a request of b()d() on object a - in Grace terms
OR as (a.(b)).d(e) 

Smalltalk just pickes the first one, basically taking the "longest" matchfix match.

Self fiddles with these rules a bit, so you have to capitalise a b: c D: e - 
Newspeak went back to the Smalltalk rules here.

I know I'll find it hard to read 
  a b c d 
as meaning
  a(b(c(d())) 
rather than
 a.b().c().d()

J


More information about the Grace-core mailing list