From: "David A. Black" Date: 2007-10-02T23:12:44+09:00 Subject: Re: a = b = c order of evaluation weird --1926193751-454653753-1191334354=:15525 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-454653753-1191334354=:15525" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-454653753-1191334354=:15525 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Tue, 2 Oct 2007, Bertram Scharpf wrote: > Hi, > > Am Dienstag, 02. Okt 2007, 22:25:26 +0900 schrieb David A. Black: >> This message is in MIME format. The first part should be readable tex= t, >> while the remaining parts are likely unreadable without MIME-aware too= ls. >> On Tue, 2 Oct 2007, Mariusz P=C4~Ykala wrote: >>> On 2007-10-02 21:06:32 +0900 (Tue, Oct), Calamitas wrote: >>>> My impression was that the OP knew what the evaluation order is, but >>>> not why it is like that. >>> >>> I guess it's safer to say that the order of evaluating arguments is >>> undefined, unless it is stated somewhere. >>> >>> Is it defined for ruby? >> >> I believe that a subscript expression is always going to be evaluated >> first: > > I never found it's good programming practice in any language > to rely on evaluation order of function/method arguments. > Understanding your own code will become unneccessarily hard. I wouldn't go out of my way to do tricks involving evaluation order, but I certainly advocate understanding what's going to happen under what circumstances. David --=20 Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info! --1926193751-454653753-1191334354=:15525-- --1926193751-454653753-1191334354=:15525--