Commit db5f3d01 authored by Anton Ertl's avatar Anton Ertl

updated .VT

parent bb52bfb4
...@@ -307,11 +307,21 @@ Variable rec' ...@@ -307,11 +307,21 @@ Variable rec'
\ print name vtable \ print name vtable
: .name? ( xt -- )
\ prints name of xt if named, otherwise prints xt as hex number
dup >name if
.name
else
hex.
then ;
: .vt ( nt -- ) : .vt ( nt -- )
>namevt @ cr >namevt @ cr
." opt: " dup >vtcompile, @ .name cr ." opt: " dup >vtcompile, @ .name? cr
." to: " dup >vtto @ .name cr ." to: " dup >vtto @ .name? cr
." >int: " dup >vt>int @ .name cr ." >int: " dup >vt>int @ .name? cr
." >comp: " dup >vt>comp @ .name cr ." >comp: " dup >vt>comp @ .name? cr
." defer@: " dup >vtdefer@ @ .name cr ." defer@: " dup >vtdefer@ @ .name? cr
." extra: " >vtextra @ hex. ; ." extra: " dup >vtextra @ .name? cr
." >string " dup >vt>string @ .name? cr
." >link " >vt>link @ .name? ;
...@@ -190,8 +190,8 @@ defer header-extra ' noop is header-extra ...@@ -190,8 +190,8 @@ defer header-extra ' noop is header-extra
vt, header-name, >namevt 2@ , cfa, vt, header-name, >namevt 2@ , cfa,
last @ 0= IF noname-vt THEN header-extra ; last @ 0= IF noname-vt THEN header-extra ;
: noname-from ( xt -- ) \ gforth : noname-from ( xt -- ) \ gforth
\G create a headerless using the example @i{xt}'s vt. \G create a nameless word using the example @i{xt}'s vt.
\G @i{xt} must be headerless. \G @i{xt} must be nameless.
vt, 0name, >namevt 2@ , cfa, ; vt, 0name, >namevt 2@ , cfa, ;
: input-stream-header ( "name" -- ) : input-stream-header ( "name" -- )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment