forax at univ-mlv.fr
Sun Feb 26 13:15:25 PST 2012
On 02/26/2012 09:18 PM, Conrad Winchester wrote:
> Hi all,
> my name is Conrad Winchester and I am a long time developer. I am currently experimenting with the new lambdas and function pointers in the Java 8 developer preview. I have come across something that strikes me as a little inconsistent in the current way that they are handled and just wanted to see what other people think. I will try to be succinct:
> I wish to add and remove function pointers to collections. I refer to the functions using a this reference. Essentially the issue is this. If I use
> then I can not use
> because the reference 'this#methodName' is different to the first one. I think this is due to the way that SAM interfaces are used to wrap the closures.
> A side effect of this is that this will return false
> public boolean checkConsistency()
> SomeSAMInterface m1 = this#methodName;
> SomeSAMInterface m2 = this#methodName;
> return m1==m2;
> I personally think that every time I use 'this#methodName' it should return the same reference. Is this correct?
> Are there any plans to make method pointers always point to the same thing. If not it makes it much more awkward to use them
> Conrad Winchester
wrong mailing list,
the one you are looking for is: lambda-dev at openjdk.java.net
see you soon.
More information about the closures-dev