From: daz Date: 2005-10-14T07:31:59+09:00 Subject: Re: array1 + array2 newb question Robert Klemme wrote: > daz wrote: > > Robert Klemme wrote: > > dz = []; a2.each{|s| dz.concat a1.map {|y| [y, s]}} > That's enlightening about #concat. When you mentioned it in reply to Simon, I read it as a reference to your use of <<. #concat is one of those methods that wasn't in my vocabulary -- I thought it was an alias for + or something ... not so. Most of the time I use << unless it causes unrequired nesting of arrays, then I go for +. What I hoped I was doing with + is what #concat does, i.e. splices to the receiving array without creating a new one. As Douglas Adams almost wrote: "Well, that just about wraps it up for Array#+" ;-) Cheers, daz + ....... Concatenation (produces a third array) concat .. Appends elements (think of as +! bang-method) push .... << << ...... Append object (alias of push)