From: Zev Blut Date: 2006-03-17T19:58:35+09:00 Subject: Re: [OT] Rant about keyword logical operators was : (Re: [ ruby-Bugs-3843 ] "not" operator used in expression that is a method parameter can generate syntax error) On Fri, 17 Mar 2006 09:13:16 +0900, Wilson Bilkovich wrote: > On 3/16/06, Joel VanderWerf wrote: >> Zev Blut wrote: >> >> > In my fantasy Ruby these keyword logical operators would not exist or >> > they would be the same precedence. >> >> But consider the difference: >> >> x = h && h[4] >> x = h and h[4] >> >> x = gets and x.display >> x = gets && x.display >> >> It's really nice having both an operator ("&&") and a control structure >> ("and") that behave the way you want them to (as in the first line of >> each pair). >> > > Maybe we just need to rename 'and' to 'and_then' or 'also', then. That would certainly make me happy! Although, Joel's above examples nicely show how the operators differ in useful ways I think it is ripe for misunderstanding and bugs. But, if you change the name to what you suggest it becomes much more clear. Thanks for the suggestion, I can now map "and" to "and_then" in my fantasy Ruby :-) Cheers, Zev