| \ \ Comments ( \ \G |
\ \ Comments ( \ \G |
| |
|
| : ( ( compilation 'ccc<close-paren>' -- ; run-time -- ) \ core,file paren |
: ( ( compilation 'ccc<close-paren>' -- ; run-time -- ) \ core,file paren |
| |
\G ** this will not get annotated. The alias in glocals.fs will instead ** |
| [char] ) parse 2drop ; immediate |
[char] ) parse 2drop ; immediate |
| |
|
| : \ ( -- ) \ core-ext backslash |
: \ ( -- ) \ core-ext,block-ext backslash |
| |
\G ** this will not get annotated. The alias in glocals.fs will instead ** |
| [ has? file [IF] ] |
[ has? file [IF] ] |
| blk @ |
blk @ |
| IF |
IF |
| AVariable lookup forth-wordlist lookup ! |
AVariable lookup forth-wordlist lookup ! |
| \ !! last is user and lookup?! jaw |
\ !! last is user and lookup?! jaw |
| AVariable current ( -- addr ) \ gforth |
AVariable current ( -- addr ) \ gforth |
| |
\G VARIABLE: holds the wid of the current compilation word list. |
| AVariable voclink forth-wordlist wordlist-link voclink ! |
AVariable voclink forth-wordlist wordlist-link voclink ! |
| lookup AValue context |
lookup AValue context ( -- addr ) \ gforth |
| |
\G VALUE: @code{context} @code{@@} is the wid of the word list at the |
| |
\G top of the search order stack. |
| |
|
| forth-wordlist current ! |
forth-wordlist current ! |
| |
|
| : (search-wordlist) ( addr count wid -- nt / false ) |
: (search-wordlist) ( addr count wid -- nt / false ) |
| dup wordlist-map @ find-method perform ; |
dup wordlist-map @ find-method perform ; |
| |
|
| : search-wordlist ( addr count wid -- 0 / xt +-1 ) \ search |
: search-wordlist ( c-addr count wid -- 0 / xt +-1 ) \ search |
| \ xt is the interpretation semantics |
\G Search the word list identified by wid |
| |
\G for the definition named by the string at c-addr count. |
| |
\G If the definition is not found, return 0. If the definition |
| |
\G is found return 1 (if the definition is immediate) or -1 |
| |
\G (if the definition is not immediate) together with the xt. |
| |
\G The xt returned represents the interpretation semantics. |
| (search-wordlist) dup if |
(search-wordlist) dup if |
| (name>intn) |
(name>intn) |
| then ; |
then ; |
| then ; |
then ; |
| |
|
| : find ( c-addr -- xt +-1 / c-addr 0 ) \ core,search |
: find ( c-addr -- xt +-1 / c-addr 0 ) \ core,search |
| |
\G Search all word lists in the current search order |
| |
\G for the definition named by the counted string at c-addr. |
| |
\G If the definition is not found, return 0. If the definition |
| |
\G is found return 1 (if the definition is immediate) or -1 |
| |
\G (if the definition is not immediate) together with the xt. |
| dup count sfind dup |
dup count sfind dup |
| if |
if |
| rot drop |
rot drop |
| \ Loadfilename ( addr u ) |
\ Loadfilename ( addr u ) |
| |
|
| : dec. ( n -- ) \ gforth |
: dec. ( n -- ) \ gforth |
| \ print value in decimal representation |
\G Display n as a signed decimal number, followed by a space. |
| base @ decimal swap . base ! ; |
base @ decimal swap . base ! ; |
| |
|
| : hex. ( u -- ) \ gforth |
: hex. ( u -- ) \ gforth |
| \ print value as unsigned hex number |
\G Display u as an unsigned hex number, prefixed with a "$" and |
| |
\G followed by a space. |
| '$ emit base @ swap hex u. base ! ; |
'$ emit base @ swap hex u. base ! ; |
| |
|
| : typewhite ( addr u -- ) \ gforth |
: typewhite ( addr u -- ) \ gforth |