On Sat, 16 Dec 2000, Ben Tilly wrote: > David Alan Black <dblack / candle.superlink.net> wrote: > > > I was talking about your hack to have a map return multiple > values, map to anon arrays then flatten. That hack will > not work on all data structures because flatten is > recursive. Your original map_with_indices didn't have > that problem. I'm totally lost now. As far as I can tell, this example: > >[1, [], [3,4,[]]] .map do |e| [e.inspect, "hello"] end .flatten > > > > => ["1", "hello", "[]", "hello", "[3, 4, []]", "hello"] showed that the business of mapping 2-for-one (using the flatten "hack") *does* work with multidimensional arrays. Can you write a little example showing a case where things get excessively flattened? > > I don't think that Ruby is list-oriented or that list-oriented ways > > of thinking are a good fit for it. Having lists with variable numbers > > of arguments is not part of the basic design and I don't think should > > be hacked on top when it doesn't fit conceptually. > > > >Now, come on Ben, admit it -- there's just a *little* bit of > >willingness to say what is and is not Ruby-esque creeping in around > >the edges, isn't there? :-) > > > Willingness does not equal ability. I was putting out a guess > based on an impression. The fact that you (with more > experience) didn't think my impression was obvious suggests that > I am missing something. Heavens -- I'm not particularly experienced. I'm a Book Baby (late October) :-) I'm a bit lost on this part of the thread too. But it's OK. David -- David Alan Black home: dblack / candle.superlink.net work: blackdav / shu.edu Web: http://pirate.shu.edu/~blackdav