diff options
| author | kitty <nepeta@canaglie.net> | 2026-04-17 01:39:34 +1000 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-04-17 01:39:34 +1000 |
| commit | 85f90aad37a469a65efd44deaafd48123c3fd59a (patch) | |
| tree | d8be85fc84899066df349238bc09539e48d6474a /sanctuary.fs | |
| parent | adfb477ea53d3e6ca7b07a77d514f56dc6a2e996 (diff) | |
loouping and start of wordlist
Diffstat (limited to 'sanctuary.fs')
| -rw-r--r-- | sanctuary.fs | 45 |
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 {{{ |
