Skip to content

Commit 50816a8

Browse files
committed
Replace breadth-first with depth-first search.
The current wording looks incorrect - `Tree`s are traversed in a depth-first manner.
1 parent e9f9c39 commit 50816a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

overviews/reflection/symbols-trees-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ this way, one must individually handle every type of node that we might come
534534
across in the pattern match. Thus, in these situations, typically class
535535
`Traverser` is used.
536536

537-
`Traverser` makes sure to visit every node in a given tree, in a breadth-first search.
537+
`Traverser` makes sure to visit every node in a given tree, in a depth-first search.
538538

539539
To use a `Traverser`, simply subclass `Traverser` and override method
540540
`traverse`. In doing so, you can simply provide custom logic to handle only
@@ -563,7 +563,7 @@ all `Apply` nodes, we could do:
563563
In the above, we intend to construct a list of `Apply` nodes that we find in
564564
our given tree.
565565

566-
We achieve this by in effect _adding_ a special case to the already breadth-first
566+
We achieve this by in effect _adding_ a special case to the already depth-first
567567
`traverse` method defined in superclass `Traverser`, via subclass
568568
`traverser`'s overridden `traverse` method. Our special case affects only
569569
nodes that match the pattern `Apply(fun, args)`, where `fun` is some function

0 commit comments

Comments
 (0)