On Fri, Feb 22, 2013 at 11:51 PM, Xavier R. <[email protected]> wrote: > Hans Mackowiak wrote in post #1098517: >> [] is not nil or false >> >> if [] >> p "like true" >> else >> p "like false" >> end >> >> >> guess what this lines will output? > > got the point. Could you give me a valid example of "&&=" ?
I think I have something even better: advice how to find out yourself. Fire up IRB and then start experimenting. It's best to start from simple expressions, so first for different combinations of a and b do a && b Look at the result. Then do a &&= b a ||= b Reason about what you see. If unsure, do more tests. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- [email protected] | https://groups.google.com/d/forum/ruby-talk-google?hl=en --- You received this message because you are subscribed to the Google Groups "ruby-talk-google" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
