summaryrefslogtreecommitdiff
path: root/sanctuary.fs
diff options
context:
space:
mode:
Diffstat (limited to 'sanctuary.fs')
-rw-r--r--sanctuary.fs16
1 files changed, 16 insertions, 0 deletions
diff --git a/sanctuary.fs b/sanctuary.fs
index 9ed0e61..4fe9f8c 100644
--- a/sanctuary.fs
+++ b/sanctuary.fs
@@ -5,4 +5,20 @@
: octal 8 base ! ;
: decimal 10 base ! ;
: hex 16 base ! ;
+
+: <mark here ;
+: <resolve here 4 + - d, ;
+: >mark here 0 d, ;
+: >resolve dup here swap - 4 - swap d! ;
+
+: begin <mark ; immediate
+: again branch <resolve ; immediate
+: until ?branch <resolve ; immediate
+: if ?branch >mark ; immediate ( I: -- a )
+: else branch >mark swap >resolve ; immediate
+: then >resolve ; immediate
+: while ?branch >mark ; immediate
+: repeat branch swap <resolve >resolve ; immediate
+
+: allot here swap dp +! ;
bye