Iterate/Subset

From Esolang
Jump to navigation Jump to search

Back to Iterate

This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

Iterate's cross-scope selectors and commands—n#, n^, ~n#, ~n^, !#, !^, &#, and &^, but excluding those which manipulate visit counts—are not necessary for the purposes of Iterate. While helpful, they can be completely ignored and trivially replaced with a stricter control flow.

n and ~n

The cross-scope variants of these two commands can easily be replaced by storing a copy of the value for later reference.

&

While replicating this is a little more complex, it can be done by setting a label's value to equate to zero where the command would run, and setting up a child loop to use that value and be skipped after it is ran. The label should be initialized back to one. Depending on how deep the command is, multiple equivalent loops that skip functionality may be necessary.

!

Breaking a parent loop functions similarly to continuing, however everything will require double-nesting in order to not only skip past the remaining content, but also prevent any further loops from occurring.