On 07/27/2012 02:42 AM, Attila Szegedi wrote:
Greetings from a small Santa Clara Oracle corner office whose surroundings are currently Swede-infested.

So, having cleared Dynalink 0.3 out of the way, I'm working on the next version.

I'm rattling an idea the last few days about adding a new MOP operation to Dynalink, "dyn:call", which'd allow calling of objects that languages recognize as first-class functions. Typical candidates are method handles, things implementing Callable etc. I started thinking of how to expose Java methods of POJOs as something that can be "dyn:call"-ed, and ended up with several different possibilities (the easiest one, but probably the not entirely optimal one is treating them as simple properties) as well as some interesting longer-term ideas such as composite MOP operations.

The writeup is here, and I'd appreciate feedback, either on the Wiki page itself or here in the e-mail thread:

<https://github.com/szegedi/dynalink/wiki/Request-for-comments:-Methods-as-properties-on-POJOs>


I'm not sure this is different from an object creation, it's a kind of reification of a function/method,
so an object creation.
Now given that for some languages, System.out.println can be a constant, the creation has to be done by an invokedynamic,
(in a lazy way by example) so must be a call of the meta object protocol.

Also, the default implementation should be able to do exactly what the jdk8 will do for lambda, exactly for method reference, i.e transforms a reference to a method (or a reference to a method + a receiver object) to see them as on object implementing a SAM interface. Note that if dynalink run on jdk8, it can directly calls the lambda metafactory (the code used by java the language).

Thanks,
  Attila.

cheers,
Rémi

--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com.
To unsubscribe from this group, send email to 
jvm-languages+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to