From 3d319290a949768b312e8464b0e5cc0c9a32ae50 Mon Sep 17 00:00:00 2001 From: kitty Date: Mon, 23 Mar 2026 02:22:28 +1100 Subject: fix broken allot, variable --- sanctuary.fs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sanctuary.fs') diff --git a/sanctuary.fs b/sanctuary.fs index eea702f..f73f052 100644 --- a/sanctuary.fs +++ b/sanctuary.fs @@ -22,7 +22,7 @@ : ?dup dup 0<> if dup then ; -: allot here swap dp +! ; +: allot dp +! ; : ?find ?dup if find 0= if 2drop abort then else abort then ; : 'h parse-name ?find ; @@ -32,6 +32,9 @@ : postpone 'h ( word ) dup immediate? if >body compile, else >body [compile] literal ['] compile, compile, then ; immediate +: cells 8 * ; +: cell+ 8 + ; +: cell- 8 - ; : create parse-name (header) latest ! ['] (create) compile, 0 , ; : does> latest @ >body 2 + ['] (does>) over ! \ replace call loc ( replace destination ) 11 + r> swap ! ; @@ -39,4 +42,5 @@ ( but it is actually compiled into the definition and is jumped to ) ( by a create does> made word ) : constant create , does> @ ; +: variable create 1 cells allot ; bye -- cgit v1.2.3