From: "David A. Black" Date: 2008-10-04T05:36:36+09:00 Subject: Re: Is Assignment in a Conditional an Idiom? Hi -- On Sat, 4 Oct 2008, List.rb wrote: > I just figured ruby was looking at the value of a returned from the > definition in the condition. The value of 'a' is still false after the > second condition. Are you talking about this one? puts "Never reached" unless (a = nil) || (!a = a) It's a peculiar line of code, but it's entirely logical. The expression !a = a has to mean !(a = a), because !a isn't an lvalue. Since a is nil, the expression a = a (or x = a, etc.) evaluates to nil. So you've basically got: unless nil || nil I might be misunderstanding the part you thought was questionable in its logic. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!