From: Robert Klemme Date: 2012-03-15T01:02:50+09:00 Subject: Re: Why doesn't "puts(4 or 5)" work? Jan E. wrote in post #1051457: > The difference is that "or" is a keyword rather than an operator. It > seems the Ruby parser doesn't allow it in some contexts. For example, > you cannot write > > [4 or 5] > {:x => 4 or 5} > > But "puts (4 or 5)" works as expected. That's probably parsed the same way as puts((4 or 5)) > Anyway, I think the logical keywords aren't actually meant to be used > outside of boolean expressions. If we want to do tricks, we're probably > supposed to use the operators. > > That's why there's an "||=" operator but no "or=". ;-) :-) Cheers robert -- Posted via http://www.ruby-forum.com/.