[Pharo-project] flatten method is kind of broken

Fabrizio Perin fabrizio.perin at gmail.com
Fri Jun 15 04:05:53 EDT 2012


Hi,
I need to flatten a collection which does not contain other collections
necessarily. The method flatten doesn't really work:

#(#(1 2) #(3 4)) flatten -> #(1 2 3 4) OK

#(#(1) #(2 3) #(#(4) 5)  ) flatten -> #(1 2 3 #(4) 5) I would have expected
something like #(1 2 3 4 5)

#(1 2 3) flatten -> error
#(#(1) 2 3) flatten -> error

Is this the meant behavior for flatten? Any other method I could use
instead?

Thanks,
Fabrizio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120615/72c23511/attachment.html>


More information about the Pharo-dev mailing list