From: David Alan Black Date: 2000-12-16T21:04:00+09:00 Subject: [ruby-talk:7427] Re: Ruby performance question On Sat, 16 Dec 2000, Dave Thomas wrote: > "Joseph McDonald" writes: > > > I take it back (again). it does not appear that an array > > is automatically converted into a hash. sorry for talking > > to myself in front of you all :-0 > > But you can use the [] constructor > > Hash[1,2,3,4] # => {1=>2, 3=>4} > > Hash[*"a=b,c=d,e=f".tr('=', ',').split(',')] > # => {"e"=>"f", "a"=>"b", "c"=>"d"} > > (note the asterisk...) Oh yeah :-) Now I remember the train of thought that led from Hash[] to Array#to_h. I really must revisit that stuff. I never got as far as trying to do it in C, which might be worthwhile. (Amazing how those to_h and interleave discussions feels like The Old Days....) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav