------art_13767_10058841.1166618168676
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 12/19/06, Peter Szinek <peter / rubyrailways.com> wrote:
>
> Mark Guzman wrote:
> > I've written up some ruby gotchas that have come up while using ruby.
> > I'm wondering if there are any other gotchas that I should be aware of.
> > The list is available at:
> > http://hasno.info/2006/12/14/ruby-gotchas-and-caveats
> >
> > I was considering adding && o the list as it's functionality seemed a
> > bit odd to me at first.
> >   --mark
> >
> From the 'Ruby way':
>
> foo  alse
> bar  rue
>
> baz  oo or bar
>
> baz ends up false (because  as greater priority than or)
>
> Cheers,
> Peter
>
> __
> http://www.rubyrailways.com
>
> interesting.  So instead of 'or' always use || unless I've got a good
reason not to.  Got it.  That's a good one to know.
irb(main):001:0> a  alse
false
irb(main):002:0> b  rue
true
irb(main):003:0> c   or b
true
irb(main):004:0> puts c
false
nil

irb(main):001:0> a  alse
false
irb(main):002:0> b  rue
true
irb(main):003:0> c   || b
true
irb(main):004:0> puts c
true
nil

------art_13767_10058841.1166618168676--