assignment: left-to-right or right-to-left evaluation?

Rainer Deyke rainerd at eldwood.com
Mon May 11 21:22:55 PDT 2009


Nick Sabalausky wrote:
> "Rainer Deyke" <rainerd at eldwood.com> wrote in message 
> news:guamfi$2b0d$1 at digitalmars.com...
>> [[mydic[x], mydic[y], mydic[z]].each].each = mydic.length;
>> ...
>>
> 
> I'm not sure what point you're trying to make here, but my idea is that 
> "each" would basically be a write-only "extension property" (to borrow C# 
> terminology) of array. So "each" wouldn't have a getter or a return value 
> and therefore trying to stick its non-existant read/return value into an 
> array literal (as you're doing above) would be an error.

I had assumed that there was some sort of magic going on that would
allow this.  If '[mydic[x], mydic[y], mydic[z]].each' is a write-only
property of an array, then assigning to it will modify the array, but
leave 'mydic' untouched.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list