all repos — hex @ 1503aaedd8214c2ee27daacb99349b0a2d619584

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

Remove cleanup symbol from utils and update test for symbols length
h3rald h3rald@h3rald.com
Mon, 07 Apr 2025 10:41:19 +0200
commit

1503aaedd8214c2ee27daacb99349b0a2d619584

parent

7acc52271935945fee18030bbcdc7fa6064d8740

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

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

@@ -105,26 +105,6 @@ "_ends_c" #

"_ends_offset" # ) "ends" :: -;;; cleanup -;; s -> -;; Frees all symbols starting with %:s%%. -( - "_cleanup_prefix" : - 0x0 "_cleanup_c" : - (_cleanup_c symbols len <) - ( - symbols _cleanup_c get "_cleanup_item" : - (_cleanup_item _cleanup_prefix begins) - (_cleanup_item #) - when - _cleanup_c 0x1 + "_cleanup_c" : - ) - while - "_cleanup_prefix" # - "_cleanup_item" # - "_cleanup_c" # -) "cleanup" :: - ;; insert ;; q1 a i -> q2 ;; Inserts item %:a%% at position %:i%% within a quotation.

@@ -293,7 +273,6 @@ _intpl_s "$" _intpl_c str cat _intpl_list _intpl_c get cat gsub "_intpl_s" :

_intpl_c 0x1 + "_intpl_c" : ) while - "_intpl_" cleanup "_intpl_s" # "_intpl_q" # "_intpl_c" #
M scripts/test.hexscripts/test.hex

@@ -130,7 +130,7 @@

((args len 0x2 ==) ("two") ("no") if "two" ==) ((dup *) "square" :: 0x2 square 0x4 == "square" #) (0x1 "tmp-a" : (tmp-a 0x3 <) (tmp-a 0x1 + "tmp-a" :) while tmp-a 0x3 ==) - (symbols len 0x5e ==) + (symbols len 0x5d ==) ;60 ((0x2 0x0 /) (error "[symbol /] Division by zero" ==) try)