From: Hal Fulton Date: 2003-12-09T05:05:28+09:00 Subject: Re: Surprising(?) behaviour of the comma operator nobu.nokada@softhome.net wrote: > Hi, > > At Mon, 8 Dec 2003 18:32:03 +0900, > Frank Schmitt wrote: > >>I just stumbled over a (at least for me) surprising behaviour >>of the comma (',') operator: > > > Ruby has no comma operator like C. > > >> irb(main):003:0> a=1, b=2 >> [1, 2] >> irb(main):004:0> puts a.class, b.class >> Array >> Fixnum >> nil > > > If you really want to use multi-statement, use semicolon (;) > instead. > Correct of course. To clarify a little for the original poster, the statement is equivalent to: a = [1, b=2] Hal