foreach, an analogy

Karen Lanrap karen at digitaldaemon.com
Fri Oct 20 09:41:49 PDT 2006


Bill Baxter wrote:

> I guess it's still possible to write the opApply tree traverser 
> non-recursively if you need to.

Yes---only guesses.

In this tree example the traversal is somehow canonical a stream of 
data without a special leading element. For such streams the 
'foreach' is well suited.

But if the traversal does have a special leading element, that must 
be treated differently, then plain old 'for' is well suited. 




More information about the Digitalmars-d-announce mailing list