From: matz@... (Yukihiro Matsumoto) Date: 2002-01-24T23:49:47+09:00 Subject: Re: Array.last Weirdness Hi, In message "Re: Array.last Weirdness" on 02/01/24, Tobias Reif writes: |Thank you very much. But I still don't understand :| Too bad. |Without knowing "the internals", they all seem to say the same: | | = + | |a[-1] = a[-1] + ' bar' | |array.last = array.last + ' bar' | |or |array.last += " world" OK, I'll try to explain again. a[-1] += b means a[-1] = a[-1] + b means a.[]=(-1, a.[](-1)+b) OK? And, accordingly, a.last += b means a.last = a.last + 1 means a.last=(a.last+1) this causes error because there's no "last=" method. |While I know why the last two don't work (because there is no #last= |mehtod), I would expect all of the following to result in the same (or I |think it would be possible, and great, if they did): I guess you mean you expect attribute setter for every attribute getter, but it doesn't always make sense. matz.