all repos — hex @ d9626f8196674e31fc9a66ce9ee5657d4909341a

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

redefined when symbol
Fabio Cevasco h3rald@h3rald.com
Fri, 03 Jan 2025 19:53:20 +0100
commit

d9626f8196674e31fc9a66ce9ee5657d4909341a

parent

309a6f89a0305768c8bd2f57d18f33fc2fbbd39a

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

jump to
M scripts/test.hexscripts/test.hex

@@ -9,6 +9,17 @@ 0x0 "result" :

(dup puts) "_" :: +( + "_when_q" : + "_when_cond" : + (_when_cond .) + (_when_q .) + () + if + "_when_q" # + "_when_cond" # +) "when" :: + ( "current-test" :

@@ -125,7 +136,7 @@ (args 0x1 get "scripts/test.hbx" ==)

;56 ((args len 0x2 ==) ("two") ("no") if "two" ==) - ((args len 0x3 !=) ("yes") when "yes" ==) + ((dup *) "square" :: 0x2 square 0x4 == "square" #) (0x1 "tmp-a" : (tmp-a 0x3 <) (tmp-a 0x1 + "tmp-a" :) while tmp-a 0x3 ==) (symbols len 0x4c ==) ;60

@@ -220,7 +231,6 @@ (("t" chr) (error) try "[symbol chr] Integer required" ==)

((() chr) (error) try "[symbol chr] Integer required" ==) ;120 - ((dup *) "square" :: 0x2 square 0x4 == "square" #) ( "test\ntest\\ntest\t\"hello\"!" "_str" : _str "test1.txt" write
M scripts/web.hexscripts/web.hex

@@ -78,6 +78,18 @@

; Convenience symbol for debugging (dup puts) "_" :: +; when operator +( + "_when_q" : + "_when_cond" : + (_when_cond .) + (_when_q .) + () + if + "_when_q" # + "_when_cond" # +) "when" :: + ; Generate tag placeholder ( "{{" swap "}}" cat cat