From: Austin Ziegler Date: 2003-04-12T07:05:56+09:00 Subject: Re: splat question On Sat, 12 Apr 2003 05:39:05 +0900, Chris Pine wrote: > bar = [2, 3, 4] > foo = [0, 1, *bar] Array#flatten. bar = [2, 3, 4] foo = [0, 1, bar] foo.flatten.length # => 5 foo.flatten You can even do: a = [1] a << a p a # => [1, [...]] p a[1] # => [1, [...]] p a[1][1] # => [1, [...]] p a[1][1][1] # => [1, [...]] a.flatten # => ArgumentError: tried to flatten recursive array Such recursion could be detected if a.id == a[i].id or the location of a.index(a). -austin -- Austin Ziegler, austin@halostatue.ca on 2003.04.11 at 17:59:28