History variables: Difference between revisions

Added Quackery.
(Added Delphi example)
(Added Quackery.)
Line 2,305:
{{out}}<lang>c: 4 -> undo x3 -> 1
HIST: {'a': [10, 20], 'i': [0, 1, 2, 3, 4], 'c': [0, 1], 'name': ['c']}</lang>
 
 
=={{header|Quackery}}==
 
Quackery does not have variables, it has ancillary stacks that can serve, amongst their uses, as variables and as history variables. Given an ancillary stack <code>x</code>, the following Quackery words are relevant.
 
*<code>x put</code> moves an item from the data stack to the ancillary stack <code>x</code>.
*<code>x take</code> moves an item from the ancillary stack <code>x</code> to the data stack.
*<code>x share</code> copies the top of the ancillary stack <code>x</code> to the data stack.
*<code>x replace</code> replaces the top item on the ancillary stack <code>x</code> with the item on top of the data stack.
*<code>x behead drop</code> leaves a copy of the ancillary stack <code>x</code> on the data stack as a nest (dynamic array).
 
 
The requirements of this task demonstrated as a dialogue in the Quackery shell.
 
<pre>/O> [ stack ] is x
... 3 x put
... 4 x put
... 5 x put
... x behead drop echo cr
... x take echo cr
... x take echo cr
... x take echo cr
...
[ 3 4 5 ]
5
4
3
</pre>
 
 
=={{header|Racket}}==
1,462

edits