From: jweirich@... Date: 2001-12-15T12:14:38+09:00 Subject: [ruby-talk:28584] Re: What is the partner of concat? >>>>> "Jim" == Jim Freeze writes: Jim> I am looking for an array function that will prepend the way Jim> concat appends. That is, concating an array places Jim> each element in the array, adding n elements, not 1 Jim> element of type array. Jim> a=[3,4];b=[1,2] Jim> a.unshift b # = > [[1,2],3,4] Jim> I want Jim> [1,2,3,4] Jim> and would prefer not to have to use flatten Jim> or collect and <<. How about this ... irb(main):001:0> a=[1,2] [1, 2] irb(main):002:0> b=[3,4] [3, 4] irb(main):003:0> a+b [1, 2, 3, 4] -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)