Hi --
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?I'm afraid I am. It's an evaluation. Boolean evaluation (with "and" / "or" having lower precedence than && / ||).
If "123 or true" isn't a statement, then it's a simple expression. And
then I would be able to do:Take a third option: It's an evaluation.
Everything evaluates to something (an object) though. Evaluation is
more a process than a special kind of syntactic construct.
No, no, no. By `puts (123 if true)` I mean: output the result of `123 if
true`.That's what I said, I was just verbose about it.
I think you said:
It is obvious, to you, that you *mean* "output 123, if 123 is true".
The code doesn't test for the truth value of 123.
David
···
On Thu, 31 Dec 2009, Phillip Gawlowski wrote:
On 31.12.2009 11:35, Albert Schlef wrote:
--
David A. Black
Senior Developer, Cyrus Innovation Inc.
THE COMPLEAT RUBYIST, Ruby training with Black/Brown/McAnally!
January 22-23, Tampa, Florida
Info and registration at http://www.thecompleatrubyist.com