From: Kent Dahl Date: 2002-10-12T02:52:19+09:00 Subject: Re: Different Behavior of Class Variables w.r.t ||= "Kontra, Gergely" wrote: > It seems like ||= has some extra hacking. Any ideas? The line a ||= b is just syntactic sugar for a = a || b Now, it looks like the new way is that the left side of the assignment (the l-value) is evaluated first, resulting in creation of the variable if it wasn't already there. Then the right hand side is evaluated and the assignment itself is done. Given a mental model with this order of events, the workings of ||= doesn't appear too magic or hackish to me, atleast. If the model was different, I would be scared to think what a = a would be parsed as, not to mention def a; 1;end a = a > Using ruby-1.7.4 under WinME, downloaded from PragmaticProgrammer > What about the above with the CVS version? Same messages with ruby 1.7.3 (2002-10-10) [i686-linux] -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)