From: pjb@... (Pascal J. Bourguignon) Date: 2009-01-27T20:42:52+09:00 Subject: Re: Time Compare Brian Candler writes: > Robert Klemme wrote: >> is_between = now > yesterday and now < tomorrow > > Danger danger!!! > > irb(main):012:0> foo = 3 > 1 and 3 < 2 > => false > irb(main):013:0> foo > => true > > 'and' and 'or' have lower precedence even than '=', so it's parsed as > > (foo = 3 > 1) and (3 < 2) > > The moral is: don't use these very-low precedence operators unless you > really know what you're doing. And even then, use parentheses to be > sure. Learned the hard way :-) That's the second time today I notice that you are required to use parentheses in Ruby (cf. m(arg){block}). Would that be a Lots of Insipid and Stupid Parentheses language? In anycase, I've got too small a brain to remember such rules, I put parentheses everywhere. -- __Pascal Bourguignon__