The Register
The register is a global value that can be modified and retrieved throughout the program. Typically, using the register is not golfier because tacit programming allows calling functions on arguments without explicitly referring to them; however, sometimes, saving a specific value to be used much further down the chain is necessary, and it can be helpful for storing evaluated strings for ASCII-art challenges.
There are three built-ins available for interfacing with the register:
®
is a niladic atom which returns the current value of the register. Initially, the register is0
.©
is a quick which accepts a link and returns a link of the same arity. When this link is run, its result is saved to the register and it is returned (so, other than the register side-effect, this link functions identically).ɼ
is a quick which accepts a link and returns a link of one lower arity, or zero. For a niladic link, it sets the register to that nilad and returns its value. For a monadic link, it applies that link to the register and sets the register to the result and returns it (the resulting link is a nilad). For a dyadic link, it returns a monadic link which applies that link to the register (on the left) and the left argument (on the right), stores the result, and returns it.