all repos — hex @ 4fc41af9c5fc6d70f41e05caaaf79b73617cd709

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

Implemented over and cons
Fabio Cevasco h3rald@h3rald.com
Sun, 06 Apr 2025 21:10:53 +0200
commit

4fc41af9c5fc6d70f41e05caaaf79b73617cd709

parent

c62cd1b35362b6ca09184537cdfc458418437963

1 files changed, 16 insertions(+), 0 deletions(-)

jump to
M lib/utils.hexlib/utils.hex

@@ -20,6 +20,22 @@ swap

if ) "unless" :: +;;; cons +;; a q1 -> q2 +;; Prepends %:a%% to %:q1%%. +( + swap quote swap cat +) "cons" :: + +;;; over +;; a1 a2 -> a1 a2 a1 +;; Copies the second item on the stack and pushes it on top +( + "_over_a" : + dup _over_a swap + "_over_a" # +) "ovar" :: + ;; isi ;; a -> i ;; Pushes %%0x1%% on the stack if %:a%% is an integer, %%0x0%% otherwise.