From Newsgroup: comp.lang.postscript
Programming in stack-based languages is notoriously error-prone: it is way
too easy to lose track of where an operand on the stack came from, and
leave too many or too few operands for an operation.
GXScript <
https://bitbucket.org/ldo17/gxscript> defines operators rCL</rCY (which I call rCLstackbeginrCY) and rCL/>rCY (which I call rCLstackendrCY). They are
used as follows:
-2n-+ </
where -2n-+ is a non-negative integer, pops -2n-+ operands off the top of the current operand stack (obviously it must contain at least that many), and
puts these on a new operand stack, which becomes the current stack, while
the previous stack becomes (temporarily) inaccessible, but saved on a
stack of stacks, as it were.
Correspondingly,
-2n-+ />
verifies that the current operand stack contains exactly -2n-+ items; it
pops these off, discards the current operand stack, restores the previous
one, and pushes those values on.
The stack of stacks allows these </ ... /> sequences to be nested to any desired depth.
The rCL;rCY operator is quite simple: it asserts that the current operand stack is currently empty, raising an error if not.
Simple, even trivial, example:
/try
{
2 </
add
1 />
}
ddef
2 3 try = ;
prints
5
--- Synchronet 3.21d-Linux NewsLink 1.2