From: "David A. Black" Date: 2004-07-14T04:57:39+09:00 Subject: Re: Ruby quickies and useful idioms Hi -- On Wed, 14 Jul 2004, Joel VanderWerf wrote: > Martin DeMello wrote: > > A flatten_once would really be a useful method to have around. > > > > martin > > Yes. Maybe even flatten(n). There's flattenx on RAA (http://raa.ruby-lang.org/project/flattenx). It gives you four methods: Array#flatten_once # [[1,2,[3]]] => [1,2,[3]] Array#flatten_by(n) # does the above n times Array#flatten_once! # in-place version Array#flatten_by!(n) # in-place version David -- David A. Black dblack@wobblini.net