Loading kernel/comp.fs +14 −9 Original line number Original line Diff line number Diff line Loading @@ -185,15 +185,20 @@ defer header-extra ' noop is header-extra \G create a header for a word \G create a header for a word vt, header-name, vttemplate namevt, ?noname-vt header-extra ; vt, header-name, vttemplate namevt, ?noname-vt header-extra ; : create-from ( xt -- ) \ gforth : create-from ( nt "name" -- ) \ gforth \G create a word using the example @i{xt}'s vt. \G Create a word @i{name} that behaves like @i{nt}, but with an \G @i{xt} must have a name. The resulting header \G empty body. @i{nt} must be the nt of a named word. The \G is not yet revealed. \G resulting header is not yet revealed. Creating a word with \G @code{create-from} without using any @code{set-} words is \G faster than if you create a word using @code{set-} words, \G @code{immediate}, or @code{does>}. You can use @code{noname} \G with @code{create-from}. 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 nameless word using the example @i{xt}'s vt. \G Create a nameless word that behaves like @i{xt}, but with an \G @i{xt} must be nameless. \G empty body. @i{xt} must be the nt of a nameless word. vt, 0name, >namevt 2@ , cfa, ; vt, 0name, >namevt 2@ , cfa, ; : input-stream-header ( "name" -- ) : input-stream-header ( "name" -- ) Loading Loading
kernel/comp.fs +14 −9 Original line number Original line Diff line number Diff line Loading @@ -185,15 +185,20 @@ defer header-extra ' noop is header-extra \G create a header for a word \G create a header for a word vt, header-name, vttemplate namevt, ?noname-vt header-extra ; vt, header-name, vttemplate namevt, ?noname-vt header-extra ; : create-from ( xt -- ) \ gforth : create-from ( nt "name" -- ) \ gforth \G create a word using the example @i{xt}'s vt. \G Create a word @i{name} that behaves like @i{nt}, but with an \G @i{xt} must have a name. The resulting header \G empty body. @i{nt} must be the nt of a named word. The \G is not yet revealed. \G resulting header is not yet revealed. Creating a word with \G @code{create-from} without using any @code{set-} words is \G faster than if you create a word using @code{set-} words, \G @code{immediate}, or @code{does>}. You can use @code{noname} \G with @code{create-from}. 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 nameless word using the example @i{xt}'s vt. \G Create a nameless word that behaves like @i{xt}, but with an \G @i{xt} must be nameless. \G empty body. @i{xt} must be the nt of a nameless word. vt, 0name, >namevt 2@ , cfa, ; vt, 0name, >namevt 2@ , cfa, ; : input-stream-header ( "name" -- ) : input-stream-header ( "name" -- ) Loading