this should not refer to the lambda

Mark Mahieu markmahieu at googlemail.com
Sun Feb 21 16:53:06 PST 2010


On 22 Feb 2010, at 00:15, Alex Blewitt wrote:

> On 21 Feb 2010, at 23:49, Neal Gafter wrote:
> 
>> On Sun, Feb 21, 2010 at 3:25 PM, Alex Blewitt <alex.blewitt at gmail.com> wrote:
>>>> I don't know what you mean by "break the language model".
>>> 
>>> I don't know any construct in Java - or for that matter, other languages - where the
>>> RHS of an assignment expression can refer to the lHS of the assignment expression,
>>> as  you proposed in http://mail.openjdk.java.net/pipermail/lambda-dev/2010-February/000833.html
>> 
>> I didn't propose anything for the assignment expression.  I proposed
>> something about the initialization in a variable declaration.
> 
> The argument still stands for initialisation in the Java language. There are no other variable initialisation types where the RHS can refer to the LHS.


class Foo {             
	Runnable r = new Runnable() {
		public void run() {
			r.run();
		}
	};
}

That's an example in which it's fine for the RHS to refer to the LHS.  The same may well apply for a local variable declaration where the RHS is a lambda expression (depending on how they're defined).

Regards,

Mark



More information about the lambda-dev mailing list