From ae1c341e4ce177a83fa678615103f32677888ed8 Mon Sep 17 00:00:00 2001 From: kitty Date: Mon, 23 Mar 2026 20:26:02 +1100 Subject: strings + nip and tuck --- sanctuary.fs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sanctuary.fs') diff --git a/sanctuary.fs b/sanctuary.fs index 6bdfbfc..6bc19e1 100644 --- a/sanctuary.fs +++ b/sanctuary.fs @@ -6,6 +6,9 @@ : decimal 10 base ! ; : hex 16 base ! ; +: nip swap drop ; +: tuck swap over ; + : mark here 0 d, ; @@ -52,4 +55,14 @@ 0 constant false -1 constant true + +: cmove, dup >r here swap cmove r> allot ; +: s" 1 >in +! [ char " ] literal parse ( a u ) + branch >mark >r 2dup cmove, nip ( u ) ( R: mark ) + r> dup >resolve 4 + ( u a ) + postpone literal ( a ) postpone literal ( u ) ; immediate compile-only + +1 constant stdout +2 constant stderr + bye -- cgit v1.2.3