summaryrefslogtreecommitdiff
path: root/sanctuary.fs
diff options
context:
space:
mode:
Diffstat (limited to 'sanctuary.fs')
-rw-r--r--sanctuary.fs45
1 files changed, 36 insertions, 9 deletions
diff --git a/sanctuary.fs b/sanctuary.fs
index 8880ccb..018da63 100644
--- a/sanctuary.fs
+++ b/sanctuary.fs
@@ -349,30 +349,57 @@ privatise
\ DO LOOP {{{
\ todo doc
-: do postpone swap postpone >r postpone >r <mark ; immediate compile-only
-\ : ?do postpone <> ?branch >mark
-\ postpone swap postpone >r postpone >r <mark ; immediate compile-only
-: +loop postpone r> postpone + postpone r@
+: do ( comp: -- mark f )
+ postpone swap postpone >r postpone >r <mark false ; immediate compile-only
+: ?do ( comp: ?domark mark t ) postpone 2dup postpone <> ?branch >mark
+ postpone swap postpone >r postpone >r <mark true ; immediate compile-only
+: +loop ( ? ) >r
+ postpone r> postpone + postpone r@
postpone over postpone >r ( n+i lim , R: lim n+i )
postpone >=
?branch <resolve
- postpone rdrop postpone rdrop ; immediate compile-only
+ postpone rdrop postpone rdrop
+ r> ( ?domark t | f -- ) true = if
+ >resolve
+ then ; immediate compile-only
\ todo -loop
-: loop postpone r> postpone 1+ postpone r@
+: loop ( ? ) >r
+ postpone r> postpone 1+ postpone r@
postpone over postpone >r ( n+i lim , R: lim n+i )
postpone >=
?branch <resolve
- postpone rdrop postpone rdrop ; immediate compile-only
-: i r@ ;
+ postpone rdrop postpone rdrop
+ r> ( ?domark t | f -- ) true = if
+ >resolve
+ then ; immediate compile-only
+: i rp cell+ @ ;
\ }}}
+bye
+
\ VOCABULARY {{{
-\ do this after user input and stuff is Working
+\ todo doc
\ words in asm that use latest directly:
\ find (header) : ; smudge immediate compile-only
+\ the easiest (altho kind of ugly) way i'll probably do this
+\ is to just redefine all of these here
+\ we don't need to redo ; because we already did it above
32 constant #vocs \ #context better name ?
variable #order
create context #vocs cells allot
+
+: wordlist here 0 , ;
+: vocabulary wordlist create , does> ( todo ) ;
+
+: get-order ( -- widn ... wid1 n ) ;
+: set-order ( widn ... wid1 n -- ) ;
+
+\ private{
+\ }private
+\ \ the actual setup is in a compiled word to prevent
+\ \ the system from shitfucking itself when its only halfway done setting up
+\ :noname ; execute
+\ privatise
\ }}}
\ PROGRAMMING TOOLS {{{