Reified Lambda Functions

Howard Lovatt howard.lovatt at iee.org
Thu Jan 7 07:41:55 PST 2010


Hi,

Yet again I have added this to the TODO list :) - see section 2.

Apart from the obvious; its easier to add to the TODO list than do
something, using the TODO list also allows me to concentrate on the main
game of the reifying mechanism. All the items on the TODO list will need
addressing, hopefully other lambda-dev discussions will resolve them.

Thanks for the comment,

 -- Howard.

2010/1/7 Alex Blewitt <alex.blewitt at gmail.com>

> On Jan 7, 2010, at 14:27, Howard Lovatt wrote:
>
> Thanks for pointing these mistakes out. I have updated the proposal in
> response, see section 2.
>
>
> :-) Nothing like putting something on the TODO list ...
>
> #_R_(_A_ _N_) (_E_)Which creates a new lambda instance
>
>
> I think terminology here could do with some thought, but there's not been
> much discussion on it when proposed:
>
> http://mail.openjdk.java.net/pipermail/lambda-dev/2009-December/000136.html
>
> Specifically, is this creating an instance, or just defining a lambda? If
> it doesn't capture any information (e.g. an identity function) should the
> compiler be free to promote it to some kind of permanent instance (e.g.
> pulling it up to be statically defined and/or lazy instantiated singleton)?
> Using 'instance' here might be misleading if only because logically, the
> lambda might or might not be instantiated at that point depending on what
> the lambda body is/does.
>
> Of course, from a semantic point of view, this is just defining a lambda,
> and one shouldn't confuse the semantics with the implementation
> optimisations that may or may not be used ...
>
> I'd propose changing this to 'defines a lambda (expression)' since this
> might not be confused with (anonymous) object instantiation.
>
> Similarly, the title in 5.1 talks about 'lambda instances' and there
> explicitly defines them to be 'new $Callable$'. We might want to define them
> as 'equivalent to' but note that the compiler may be free to avoid the
> instantiation each time if the result of that instantiation would be
> equivalent to keeping a cached version.
>
> (This in turn leads to a question - if such a lambda is used once, would
> keeping it around defeat the purpose of being able to garbage collect the
> type? would a weak reference to a singleton be a better implementation
> detail?)
>
> Alex
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>



-- 
 -- Howard.


More information about the lambda-dev mailing list