| : noname ( -- ) \ gforth |
: noname ( -- ) \ gforth |
| \g The next defined word will be anonymous. The defining word will |
\g The next defined word will be anonymous. The defining word will |
| \g leave the input stream alone. The xt of the defined word will |
\g leave the input stream alone. The xt of the defined word will |
| \g be given by @code{lastxt}. |
\g be given by @code{latestxt}. |
| ['] noname-header IS (header) ; |
['] noname-header IS (header) ; |
| |
|
| : lastxt ( -- xt ) \ gforth |
: latestxt ( -- xt ) \ gforth |
| \G @i{xt} is the execution token of the last word defined. |
\G @i{xt} is the execution token of the last word defined. |
| \ The main purpose of this word is to get the xt of words defined using noname |
\ The main purpose of this word is to get the xt of words defined using noname |
| lastcfa @ ; |
lastcfa @ ; |
| |
|
| |
' latestxt alias lastxt \ gforth-obsolete |
| |
\G old name for @code{latestxt}. |
| |
|
| |
: latest ( -- nt ) \ gforth |
| |
\G @var{nt} is the name token of the last word defined; it is 0 if the |
| |
\G last word has no name. |
| |
last @ ; |
| |
|
| \ \ literals 17dec92py |
\ \ literals 17dec92py |
| |
|
| : Literal ( compilation n -- ; run-time -- n ) \ core |
: Literal ( compilation n -- ; run-time -- n ) \ core |
| [THEN] |
[THEN] |
| |
|
| : !does ( addr -- ) \ gforth store-does |
: !does ( addr -- ) \ gforth store-does |
| lastxt does-code! ; |
latestxt does-code! ; |
| |
|
| : (does>) ( R: addr -- ) |
: (does>) ( R: addr -- ) |
| r> cfaligned /does-handler + !does ; |
r> cfaligned /does-handler + !does ; |
| |
|
| : recurse ( compilation -- ; run-time ?? -- ?? ) \ core |
: recurse ( compilation -- ; run-time ?? -- ?? ) \ core |
| \g Call the current definition. |
\g Call the current definition. |
| lastxt compile, ; immediate restrict |
latestxt compile, ; immediate restrict |
| |
|
| \ \ compiler loop |
\ \ compiler loop |
| |
|
| : lastflags ( -- c-addr ) |
: lastflags ( -- c-addr ) |
| \ the address of the flags byte in the last header |
\ the address of the flags byte in the last header |
| \ aborts if the last defined word was headerless |
\ aborts if the last defined word was headerless |
| last @ dup 0= abort" last word was headerless" cell+ ; |
latest dup 0= abort" last word was headerless" cell+ ; |
| |
|
| : immediate ( -- ) \ core |
: immediate ( -- ) \ core |
| \G Make the compilation semantics of a word be to @code{execute} |
\G Make the compilation semantics of a word be to @code{execute} |
| \ \ Search list handling: reveal words, recursive 23feb93py |
\ \ Search list handling: reveal words, recursive 23feb93py |
| |
|
| : last? ( -- false / nfa nfa ) |
: last? ( -- false / nfa nfa ) |
| last @ ?dup ; |
latest ?dup ; |
| |
|
| : (reveal) ( nt wid -- ) |
: (reveal) ( nt wid -- ) |
| wordlist-id dup >r |
wordlist-id dup >r |