From: Lyndon Samson Date: 2005-11-23T12:07:44+09:00 Subject: Re: what is the ruby way to do this? ------=_Part_2066_27187000.1132715258702 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It would be nice if there was a wiki page somewhere of these Uberdioms... On 11/23/05, Rob Rypka wrote: > > On 11/22/05, David A. Black wrote: > > On Wed, 23 Nov 2005, Jeff Wood wrote: > > > > > I would do > > > > > > a =3D Hash.new { || [] } > > > > I believe that's the first empty || I've ever seen. It's awfully > > confusing (my first reaction was: *what* or an empty array? :-) I'd > > strongly encourage you to eschew that construct. It's deservedly > > unheard of :-) > > Perhaps I'm missing something. Is there something wrong with the > following? > > a =3D Hash.new { [] } > > irb tells me that it gets a new array each time. > > -- > Rob (votes with David on this one - bleah) > > -- Into RFID? www.rfidnewsupdate.com Simple, fast, news. ------=_Part_2066_27187000.1132715258702--