Pep and Nom

home | documentation | examples | translators | download | blog | all blog posts

the ℕ𝕠𝕞 "swap" command

Swap the contents of the workspace buffer with the current tape cell

Swaps the contents of the current tape-cell with the “workspace” buffer. The swap command allows the tape-cell to be added to the beginning of the workspace, not the end, using the swap get command combination.

The swap command is sometimes useful for 'juggling' the contents of the workspace with the current tape cell. For example if we need to compile the attribute for a new parse-token but at the same time preserve the value of the original parse token (the parse token that is being reduced )

prepend the current tape cell to the workspace buffer
 swap; get;

notes

All ℕ𝕠𝕞 commands have a one letter abbreviation. For swap the abbreviation is 'x'