Show the internal state of the ℙ𝕖𝕡 machine at the time that the command is issued.
The state command displays the internal state of the pep virtual machine at the time that the command is executed. This is extremely useful for debugging and highly recommended. It even shows coloured output when executed from the ℙ𝕖𝕡 interpreter.
[:space:] { while [:space:]; put; clear; add "space*"; push; .reparse }
![:space:] { whilenot [:space:]; put; clear; add "word*"; push; .reparse }
clear;
parse>
pop;pop;pop;
"word*space*word*","words*space*word*" {
state; clear; add "words*"; push; .reparse
}
push;push;push;
Using the state command is basically a speedy version of invoking
a script with the pep interactive debugger which is more powerful
but slower. The interactive debugger allows you to step through the
ℕ𝕠𝕞 program one instruction at a time and view the state
of
the pep machine (it also has many other useful commands which
may be useful for learning about the
ℙ𝕖𝕡 virtual machine ).
pep -Ie 'r;add "/";print;clear;' -i 'abcdef'