[squeak-dev] The Inbox: Collections-fbs.489.mcz

Colin Putney colin at wiresong.com
Mon Aug 20 17:29:57 UTC 2012


On Mon, Aug 20, 2012 at 10:04 AM, Frank Shearar <frank.shearar at gmail.com> wrote:
> Another way to flatten without flattening would be to have an external
> iterator: PreOrderTraversal on: myNestedCollection could define all
> the usual collection methods, and use the underlying collections'
> #do:. (And such an iterator could iterate over heterogeneous
> structures too.)

I quite like this approach. I used it in Filesystem, for walking
directory trees. See FSPreorderGuide, FSPostorderGuide and
FSBreadthFirstGuide. The term "Guide" comes from the fact that they
work with Visitors, guiding them around the filesystem.

Colin


More information about the Squeak-dev mailing list