From: David Alan Black Date: 2001-12-31T21:30:13+09:00 Subject: [ruby-talk:29844] Re: && vs. and Hello -- On Mon, 31 Dec 2001, Le Wang wrote: > Hi all, > > In "Programming Ruby", it was explained that the only difference > between '&&' and 'and' is precedence, the same seems to be implied in > the 1.4 Reference Manual. > > > true and puts 'test' > true && puts 'test' > > > Why doesn't the second statement work? I believe it's parsed as: (true && puts) 'test' so the bare string 'test' at the end of the line causes a parse error. Try: true && puts('test') (Hmmm... Playing around with this I'm mildly surprised that "true && nil" is nil, rather than false.) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav