-
-
Save treeform/98be9388064b15753d0f12644c2d2348 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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