all repos — hex @ dca658babc2b277224e1a884d3f5e8682e837cb8

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

fixes
h3rald h3rald@h3rald.com
Sat, 29 Mar 2025 17:35:04 +0100
commit

dca658babc2b277224e1a884d3f5e8682e837cb8

parent

90073bb2ee3d2ff0f2e85cd32c6502867a85b434

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M web/contents/spec.htmlweb/contents/spec.html

@@ -280,10 +280,10 @@ <p>By contrast, you can only store hex literals as user-defined symbols. When storing a quotation as a symbol, it can be used as data (a list of values) or a portion of an hex program which that can then

be <em>dequoted</em> through symbols like {{sym-.}}, which pushes all the items in a quotations on the stack, one by one.</p> <p>Consider the following example hex program:</p> - <pre><code> ($:dup$$ $:*$$ $:*$$) $"square"$$ $:::$$ + <pre><code> ($:dup$$ $:*$$ $:*$$) $"square"$$ $::$$ $0x3$$ $:square$$ $:.$$ $:puts$$ $; prints 9$$</code></pre> <p>This program defines a symbol $:square$$ that can be used to calculate the square value of an integer, using the - symbol {{sym-::}}. From then on, if $:square$$ is found anywhere in the same hex program, it + symbol {{sym-:}}. From then on, if $:square$$ is found anywhere in the same hex program, it will be substituted with <code>($:*$$ $:*$$)</code>. However, this is not enough to calculate the square value, because the logic to do so is in a quotation. To "execute" (dequote) a quotation, you must use the {{sym-.}} symbol, which pushes all the items in the quotation on the stack, which is equivalent