Syntax...
Rémi Forax
forax at univ-mlv.fr
Sat Nov 21 13:00:09 PST 2009
Le 21/11/2009 21:04, Neal Gafter a écrit :
> Vladimir-
>
> We've been carefully avoiding keywords up to now, but I agree using
> keywords could result in more natural-reading programs. The problem
> is the risk of breaking existing programs. However, that is somewhat
> less severe now that there is a syntax for "exotic" identifiers. In
> JDK7 a keyword can still be used as an identifier by using the exotic
> identifier escape syntax. So the breakage is not as bad as it would
> have been earlier. It might be possible to use context-sensitive
> keywords, too.
>
> I would probably want to use something like 'fun' in place of '#' for
> function types, and 'lambda' or 'fun' in place of '#' for lambda
> expressions.
>
> fun int(int) plus1 = lambda (int x) x+1;
>
> I also prefer the result type on the right-hand-side of a function
> types, but somepeople seem to have trouble with that:
>
> fun (int)->int plus1 = lambda (int x) x+1;
[...]
I vote for fun and lambda too.
Neal do you have planned to try to patch the parser to see if their
introduction is possible or not ?
BTW, I am one of the mob that doesn't like arrow, it's too warlike for me :)
cheers,
Rémi
More information about the closures-dev
mailing list