Clarify the sense in which Nim supports recursive iterators in the (#15834)

manual, the tutorial, and the `tbintree` test.
This commit is contained in:
c-blake 2020-11-04 10:56:22 -05:00 • committed by GitHub
commit f17555770e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 7 deletions

View file

@ -511,8 +511,8 @@ containers:
iterator preorder*[T](root: BinaryTree[T]): T =
# Preorder traversal of a binary tree.
# Since recursive iterators are not yet implemented,
# this uses an explicit stack (which is more efficient anyway):
# This uses an explicit stack (which is more efficient than
# a recursive iterator factory).
var stack: seq[BinaryTree[T]] = @[root]
while stack.len > 0:
var n = stack.pop()