Skip to content

Instantly share code, notes, and snippets.

@treeform
Last active May 19, 2019 16:46
Show Gist options
  • Save treeform/98be9388064b15753d0f12644c2d2348 to your computer and use it in GitHub Desktop.
Save treeform/98be9388064b15753d0f12644c2d2348 to your computer and use it in GitHub Desktop.
type Node = object
nodes: seq[Node]
iterator all(n: Node): Node =
for node in n.nodes:
for n in node.all():
yield n
# Error: recursive dependency: 'all'
type Node = object
nodes: seq[Node]
iterator all(n: Node): Node
iterator all(n: Node): Node =
for node in n.nodes:
for n in node.all():
yield n
# Error: implementation of 'all' expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment