Alternative syntax for closures
forax at univ-mlv.fr
Tue Jul 8 00:42:31 PDT 2008
Neal Gafter a écrit :
> On Mon, Jul 7, 2008 at 6:19 AM, Rémi Forax <forax at univ-mlv.fr
> <mailto:forax at univ-mlv.fr>> wrote:
> I've just written a blog about an alternative syntax:
> That's nice, but it doesn't really help evaluate this alternative.
It's just a syntax alternative, not a semantic alternative to BGGA.
I don't like the fact BGGA use curly braces to define an expression,
use a non natural (non Javaish) order between return type and parameter
in function type syntax and use two different types for
restricted/unrestricted function types
which is too complex.
Furthermore, i don't like exception type parameter, too complex too,
that why i've proposed
a different syntax for method that takes an unrestricted closure, this
perform exception transparency seamlessly and avoid create a type for
unrestricted function type
(like T... which is only available in method declaration).
> If your proposal, I see you use, but don't define, the syntax for
> function types.
> I see you allow referring to a method by its simple name as a closure,
> but I don't know what name lookup rules you have in mind that would
> make that possible.
method name lookup is defined by 15.12.2 (JLS3), i don't want to change it.
More information about the closures-dev