summaryrefslogtreecommitdiff
path: root/sanctuary.fs
diff options
context:
space:
mode:
Diffstat (limited to 'sanctuary.fs')
-rw-r--r--sanctuary.fs8
1 files changed, 6 insertions, 2 deletions
diff --git a/sanctuary.fs b/sanctuary.fs
index b0867d1..eea702f 100644
--- a/sanctuary.fs
+++ b/sanctuary.fs
@@ -32,7 +32,11 @@
: postpone 'h ( word ) dup immediate? if >body compile,
else >body [compile] literal ['] compile, compile, then ; immediate
-\ my plan is that (CREATE) is followed by a dummy zero cell
-\ which (DOES>) uses. waste of 8 bytes but it's simpler
: create parse-name (header) latest ! ['] (create) compile, 0 , ;
+: does> latest @ >body 2 + ['] (does>) over ! \ replace call loc
+ ( replace destination ) 11 + r> swap ! ;
+ ( the lone r> means we don't execute the rest of the word now, )
+ ( but it is actually compiled into the definition and is jumped to )
+ ( by a create does> made word )
+: constant create , does> @ ;
bye