adrian-thurston / colm

The Colm Programming Language
MIT License
164 stars 32 forks source link

badly need non-recursive generic tree iterators #111

Open adrian-thurston opened 4 years ago

adrian-thurston commented 4 years ago

In practice, often run up against the need to iterate without going into the thing we are looking for. For example, if looking for a right-recursive thing that is just the base case, after rewriting it we go into it and find the base case again, causing infinite rewriting.

Can work around this by looking for the parent, and for each parent using a second iterator with a break in the body.