all repos — hex @ d10a2c0c62aae766a51324c80cc2a88f2f2ace94

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

Fix pop implementation and update test for symbols length
h3rald h3rald@h3rald.com
Tue, 08 Apr 2025 07:24:51 +0200
commit

d10a2c0c62aae766a51324c80cc2a88f2f2ace94

parent

b389ca018fe6ed4ed28057e1705baec630f075c7

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

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

@@ -34,7 +34,7 @@ (

"_pop_q" : () "_pop_res" : 0x0 "_pop_c" : - (_pop_c _pop_q len 1 - <) + (_pop_c _pop_q len 0x1 - <) ( _pop_res _pop_q _pop_c get push "_pop_res" : _pop_c 0x1 + "_pop_c" :

@@ -44,7 +44,7 @@ _pop_res

"_pop_q" # "_pop_res" # "_pop_c" # -) "pop" +) "pop" :: ;;; cons ;; a q1 -> q2
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 0x5f ==) ;60 ((0x2 0x0 /) (error "[symbol /] Division by zero" ==) try)

@@ -142,7 +142,7 @@

(0x2 dup stack (0x2 0x2) ==) ((dup *) "square" :: 0x3 square 0x9 == "square" #) (("test" throw) (error "test" ==) try) - (0x1 0x2 swap drop drop drop stack (0x2) ==) + (0x1 0x2 swap drop drop drop stack (0x2) == swap drop) ; Also make sure to clear the stack polluted with #65 ;68 (("aaa" "puts" :) (error) try "[symbol :] Failed to store symbol 'puts'" ==)