From: Stefan Rusterholz Date: 2008-12-04T16:58:52+09:00 Subject: Re: 'and' keyword? List Rb wrote: > Because puts("hi") yields nil, the second item never gets called: > puts "hi" and puts "bye" if true > > I can work around it with these: > !puts "hi" and puts "bye" if true > puts "hi";puts "bye" if true > [puts("hi"), puts("bye")] if true > > --But was hoping there was a more aesthetic one liner out there that can > use > 'and'.. > > Thanks in advance!! In my opinion, using logical operators with side-effects is bad style. I'd try to avoid it. Regards Stefan -- Posted via http://www.ruby-forum.com/.