6 include term-colours.4th
10 create car memsize allot
11 create cdr memsize allot
12 create types memsize allot
14 0 constant symbol-type
27 types nextfree @ + bool-type !
33 create here 1+ , allot ;
45 2dup = abort" Stack underflow."
48 -rot swap ( v sp' s0 )
57 : inc-parse-idx parse-idx +! ;
58 : dec-parse-idx parse-idx -! ;
60 : ?charavailable ( -- bool )
61 parse-str @ @ parse-idx @ >
64 : nextchar ( -- char )
66 parse-str @ 1+ parse-idx @ + @
72 : ?whitespace ( -- bool )
79 nextchar [char] ( = or
80 nextchar [char] ) = or
93 nextchar [char] # <> if false exit then
97 nextchar dup [char] t = swap [char] f = or
110 nextchar [char] t = make-bool
116 \ Set cdr at i to j, leaving j on the stack
117 : append ( i j -- j )
132 nextchar [char] ( = if
137 nextchar [char] ) = if
148 \ Parse a counted string into a scheme expression
149 : parseexp ( straddr n -- exp )
160 create repl-buffer 161 allot
163 repl-buffer parse-str !
168 bold fg green ." => " reset-term
170 repl-buffer 1+ 160 expect cr