Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Newbie Question on Operator Precedence?
Shuaib Zahda
10/31/2007 1:42:00 AM
Z T wrote:
> if false or true
> then puts 'then' #----> output is 'then'. OR gets evaluated!
> else puts 'else'
> end
>
> What's the reason? Thanks for all the help, in advance.
>
> ZT
for the if statement it gets evaluated so it is true and "then" is
evaluated.
for puts flase or ture, I tried it. I got the same result of yours.
However, I tried puts false and true. The output was false. I am not
sure about this one.
I tried this and it gave me true
puts "#{false or true}"
It gets evaluated.
Thanks
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Newbie Question on Operator Precedence?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password