From: Albert Schlef Date: 2009-12-31T19:35:18+09:00 Subject: Re: Why can't I use "or" here? Phillip Gawlowski wrote: > On 31.12.2009 10:51, Albert Schlef wrote: >> In other words, why can I do this: >> >> puts 999 >> >> But I *can't* do this: >> >> puts (123 if true) > > Because puts takes an argument, not a statement (basically). Then why can I do this? puts (123 or true) Are you going to tell me that "123 or true", unlike "123 if true", *isn't* a statement? If "123 or true" isn't a statement, then it's a simple expression. And then I would be able to do: puts(123 or true) # Note: no space before parentheses But I can't! So it follows that "123 or true" too is a statement. Let me sum it up: puts (123 if true) # Syntax error. puts (123 or true) # Works. Although both are "statements". > > The problem with computers is that they are stupid. It is obvious, to > you, that you *mean* "output 123, if 123 is true". No, no, no. By `puts (123 if true)` I mean: output the result of `123 if true`. -- Posted via http://www.ruby-forum.com/.