[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-lambda-spec-observers
Subject:    Names of desugared lambdas
From:       Brian Goetz <brian.goetz () oracle ! com>
Date:       2013-01-19 2:54:09
Message-ID: BFD92603-90FA-4851-927E-6BD07B38F86C () oracle ! com
[Download RAW message or body]

We had an action item from the last meeting, which got lost in the shuffle, to \
revisit the naming of methods that are desugared from lambda bodies.  The current \
lambda$n scheme is fine for non-serializable lambdas, but at least for serializable \
lambdas, is too sensitive to harmless refactorings like changing the order of methods \
within a class file. While we know there is no perfect solution, we can choose a \
solution that is less obviously brittle.  This brittleness is especially an issue \
with libraries (like the combinators for Comparator, which, to be consistent with \
existing Comparator implementations in the JDK, return serialiable lambdas.)  

What I propose is this: 

  lambda$mmm$kkkk$nnn

where mmm is the method name and kkk is the hashcode of the method signature, and nnn \
is a sequentially assigned number.  That way, at least lambdas within a method will \
not have any effect on lambdas from another method.  

This isn't perfect but its better than what we have.  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic