Quoting constructs: Difference between revisions

→‎{{header|Quackery}}: added commentary
(Added Quackery.)
(→‎{{header|Quackery}}: added commentary)
Line 668:
The builder <code>constant</code> evaluates the object that precedes it at runtime and embeds it as a literal during compilation, so <code>[ 10 18 ** ] constant</code> compiles as <code>1000000000000000000</code>.
 
Also relevant are look-up tables and ancillary stacks.
Another relevant word is <code>table</code>, which is used to create look-up tables. As an example, the behaviour of the nest <code>[ table 2 3 5 7 11 13 17 19 23 29 ]</code> is to take a number, n, in the range <code>0</code> to <code>9</code> (inclusive) from the data stack and put the corresponding small prime number on the data stack. <code>table</code> is not limited to returning numbers, it will handle any Quackery object, so can be considered as a quoting construct.
 
Another relevantThe word is <code>table</code>, which is used to create look-up tables. As an example, the behaviour of the nest <code>[ table 2 3 5 7 11 13 17 19 23 29 ]</code> is to take a number, n, in the range <code>0</code> to <code>9</code> (inclusive) from the data stack and put the corresponding small prime number on the data stack. <code>table</code> is not limited to returning numbers, it will handle any Quackery object, so can be considered as a quoting construct.
 
The word <code>stack</code> is used to create ancillary stacks, which, like the data stack, are places to hold data. They are the Quackery analogue to variables, but can be pre-loaded with data much like tables. As an example, this stack is preloaded with two items; there is an empty nest <code>[ ]</code> on the top of the stack, and beneath that, the number <code>123</code>: <code>[ stack 123 [ ] ]</code>.
 
=={{header|Raku}}==
1,462

edits