Hi --

On Mon, 22 Jan 2007, gwtmp01 / mac.com wrote:

>
> On Jan 21, 2007, at 3:50 PM, dblack / wobblini.net wrote:
>> That's the idea, though flattenx lets you do flatten_by(n) and also is
>> written in C for speed.
>
> I didn't see anyone else mention that in Ruby 1.9...
>
> $ ri-1.9 Array#flatten
> ---------------------------------------------------------- Array#flatten
>     array.flatten -> an_array
>     array.flatten(level) -> an_array
> ------------------------------------------------------------------------
>     Returns a new array that is a one-dimensional flattening of this
>     array (recursively). That is, for every element that is an array,
>     extract its elements into the new array. If the optional _level_
>     argument determins the level of recursion to flatten.

Cool!  I actually didn't know that had made it into 1.9.  I look
forward to retiring flattenx :-)


David

-- 
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
    (See what readers are saying!  http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)