From: Pit Capitain Date: 2003-02-12T17:53:47+09:00 Subject: Re: value of assignment (Re: Order of the value of an expression changed? (PR#579)) Hi Mathieu, thanks for the code example. > # if out-of-range, auto-adjusts percent to closest valid value > def quality=percent > @percent = [[percent,0].max,100].min > end > > According to the old behaviour, this quite reasonable piece of code makes > (o.quality=x)==o.quality always true, but according to the new behaviour, > it's no longer the case. Yes, this is true. I see your point. But, at least for me, after o.quality = 999'999 it feels strange that o.quality == 100 The auto-adjust code might be handy if you always know what you're doing, but it could also hide some errors in your program. I think if I'd want to auto-adjust instead of raising an error, I would code it like this: def adjust_to_percent( value ) [[value,0].max,100].min end percent = o.quality = adjust_to_percent( 999'999 ) to make it obvious whats going on. Regards, Pit