From: Logan Capaldo Date: 2006-08-27T11:32:43+09:00 Subject: Re: and and or priority ------=_Part_211826_14109536.1156612978151 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/26/06, Elliot Temple wrote: > > > On Aug 26, 2006, at 8:16 AM, David Vallner wrote: > > > I agree that the and should bind more tightly than or now that > > that's been brought up. > > && binds before || > > Presumably there is a special reason for and/or to be the way they > are. We should probably find out what it is before suggesting it be > changed. The general idea is that you can use and and or in similiar places as if and unless modifiers (ala "or die" in perl, at least as far as I understand it) e.g. x = string.index("h") or raise "No h in string!" Also with left to right equal precendence you can use them as a ternay operator: x = condition and value or other_value irb(main):025:0> true or true and false > => false > irb(main):026:0> true || true && false > => true > > > -- Elliot Temple > http://www.curi.us/blog/ > > > > > ------=_Part_211826_14109536.1156612978151--