Syntax... (errata)

Vladimir Kirichenko vladimir.kirichenko at gmail.com
Sun Nov 22 04:09:24 PST 2009


tronicek at fit.cvut.cz wrote:
> It is not only 'fun' vs. '#'. Compare:
> 
> #String(int, double) throws IOException | InterruptedException p;
> 
> vs.
> 
> fun String p(int, double) throws IOException, InterruptedException;

Exactly. In my proposal definition of the function is an exact match to
definition of regular java method.

class A {

	public static int staticMethod(int x) throws Exception {...}

	public static fun int staticFun(int x) throws Exception => {...}
}


> And
> 
> p.invoke(42, 3.14);
> 
> vs.
> 
> p(42, 3.14);

if would be really great if invoke in the class implementing marker
interface java.lang.Function could be invoked using simple syntax.

And if "invoke" will be named "apply" for transparent Scala interop - in
would be superb:)

-- 
Best Regards,
Vladimir Kirichenko

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091122/58c040eb/attachment.bin 


More information about the closures-dev mailing list