• Re: Proposal on LATEST-NAME

    From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Thu Sep 17 15:20:54 2026
    From Newsgroup: comp.lang.forth

    On 2025-10-05 15:25, Ruvim wrote:
    I have updated my proposal on the `latest-name` and `latest-name-in`
    words. Essentially, I have added a lot of rationale and one very
    portable reference implementation.

    See at <https://forth-standard.org/proposals/new-words-latest-name-and- latest-name-in?hideDiff#reply-1573>

    Please let me know if you have any questions or suggestions on this
    regard. Note that this webpage contains previous versions of the
    proposal above the specified anchor.


    There is a certain tension between the return type `nt|0` in one case
    and `nt` in the other.


    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?


    --
    Ruvim

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Krishna Myneni@krishna.myneni@ccreweb.org to comp.lang.forth on Thu Sep 17 07:21:36 2026
    From Newsgroup: comp.lang.forth

    On 10/5/25 09:38, Ruvim wrote:
    On 2025-10-05 15:51, Hans Bezemer wrote:
    On 05-10-2025 13:25, Ruvim wrote:
    I'd be happy to support LATEST-NAME as a preprocessor macro (although
    I doubt 4tH's LATEST is compatible), but I won't be introducing it in
    the native 4tH compiler for the following reasons:

    Moore:

    "There are diverging programming styles in the Forth community. One uses
    hyphenated words that express in English what the word is doing. You
    string these big long words together and you get something that is
    quite readable. But I immediately suspect that the programmer didnrCOt
    think out the words carefully enough, that the hyphen should be broken
    and the words defined separately. That isnrCOt always possible, and it
    isnrCOt always advantageous. But I suspect a hyphenated word of mixing
    two concepts."

    Which is part of TF, also tip 5.19 *"Favor short words"*

    .. and LATEST-WORD is not short.



    We had a good word there, LATEST, which I guess does at least 90% of
    the work proposed, so why not take that one?

    Many Forth systems provide "LATEST", which behaves differently, and
    changing its behavior would be backward incompatible for them.
    Therefore, it's unlikely that vendors will change the behavior of the existing word in their system and existing programs that use it (even if
    the behavior difference is only incompatible in some cases).


    Example.
    SP-Forth/4 has provides the word `REQUIRE` since 2001, and it was used
    in thousands of files. Later, a word with the same name but slightly different semantics was introduced in Forth-2012. Of course, SP-Forth/4 cannot provide this word, as this would be backward incompatible change
    for existing programs.



    It is a tendency I see within Forth-200x to take longer and longer
    words, just to avoid any collisions with existing words. And I don't
    think that's a smart move.

    Probably, a better way would be to require systems to provide only
    standard words in `forth-wordlist`, and for programs to *explicitly*
    include a system-specific word list into the search order (if they need
    it). But many people don't like this approach.



    The rationale for naming the word LATEST-NAME is also that it tells you,
    or gives you a hint, as to what it is being returned. In this case it is
    a name token, or nt, from which other properties of the word can be
    obtained e.g.

    NAME>COMPILE
    NAME>INTERPRET
    NAME>STRING

    The sequence LATEST-NAME NAME>x gives a powerful capability for
    inspecting the latest named definition added to the compilation wordlist.

    LATEST-NAME NAME>x

    In contrast, the word LATEST is not descriptive of what is being
    returned, even if there were no conflicts in its meaning in Forth systems.

    --
    Krishna

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Thu Sep 17 17:40:51 2026
    From Newsgroup: comp.lang.forth

    On 17-09-2026 13:20, Ruvim wrote:
    On 2025-10-05 15:25, Ruvim wrote:
    I have updated my proposal on the `latest-name` and `latest-name-in`
    words. Essentially, I have added a lot of rationale and one very
    portable reference implementation.

    See at
    <https://forth-standard.org/proposals/new-words-latest-name-and-
    latest-name-in?hideDiff#reply-1573>

    Please let me know if you have any questions or suggestions on this
    regard. Note that this webpage contains previous versions of the
    proposal above the specified anchor.


    There is a certain tension between the return type `nt|0` in one case
    and `nt` in the other.


    If you have the words:

    -a last-name-in ( wid -- nt|0 )
    -a last-name ( -- nt|0 )
    -a latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`?-a Are there perhaps any examples?

    Since 4tH does not have a dictionary, but a symbol table which is purged
    at the end of a compilation, I have very little use for these words,
    since there's little use to retrieve such names.

    I do have LATEST which has multiple meanings in Forth (in 4tH, it
    compiles the latest defined word, which is handy in all kinds of initializations -- since you don't have to repeat that name).

    So, in short: I'm fine. The closest my version of latest comes to the
    ANS way of doing things is: "LATESTXT EXECUTE".

    If that kind of behavior becomes part of a proposal, it's time for me to awaken once more -- but for the time being, I have nothing interesting
    to contribute, I'm afraid.

    Hans Bezemer

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Sep 17 15:42:38 2026
    From Newsgroup: comp.lang.forth

    Ruvim <ruvim.pinka@gmail.com> writes:
    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?

    Gforth has a word LATEST with the specification:

    |'latest' ( - nt|0 ) gforth-0.6
    | If the most recent word defined in the current section has a name, nt
    |is its name token; otherwise, return 0.

    That's not quite last-name, but it's similar. It is used in the
    following contexts that handle the 0 and do not throw:

    : reveal ( -- ) \ gforth
    \G Put the current word in the wordlist current at the time of the
    \G header definition.
    latest ?dup-if \ the last word has a header
    dup >link @ 1 and
    if \ it is still hidden
    dup >link @ 1 xor ( nt wid )
    reveal!
    else
    drop
    then
    then ;

    : addressable ( -- ) \ gforth-internal
    \G Mark the last word (if named) as addressable
    latest IF addressable-mask lastflags or! THEN ;

    Here we have a case that explicitly throws if the result is 0 (like
    your LATEST-NAME):

    : lastflags ( -- c-addr )
    \ the address of the flags byte in the last header
    \ aborts if the last defined word was headerless
    latest dup 0= abort" last word was nameless"
    >f+c ;

    And the following cases where LATEST is guaranteed not to return 0:

    : extra-section ( usize "name" -- ) \ gforth
    \G Define a new word @i{name} and create a section @i{s} with at
    \G least @i{usize} unused bytes.@* @i{Name} execution @code{(
    \G ... xt -- ... )}: When calling @i{name}, the current section is
    \G @i{c}. Switch the current section to be @i{s}, @i{execute} xt,
    \G then switch the current section back to @i{c}.
    section-desc + pagealigned
    create-section dup >extra-sections
    create , latest [: section-name ! ;] over @ section-execute
    does> ( xt -- )
    @ section-execute ;

    : Locale: ( "name" -- ) \ gforth-experimental
    \G Defines a new locale @i{l} with name @i{name} in
    \G @word{locales}.@* @i{name} execution: ( -- ) @i{l} becomes the
    \G current locale.@* For locales with names of the form
    \G @code{@i{X}_@i{Y}}, define @code{@i{X}} first in order to
    \G establish @code{@i{X}} as a fallback for @code{@i{X}_@i{Y}}.
    [: ['] locales >wordlist set-current
    `locales:program create-from reveal ;]
    current-execute here $[]saved 0 ,
    latest name>string '_' -scan dup IF
    ['] locales >wordlist find-name-in
    dup IF name>interpret >body ELSE drop `locales:default THEN
    ELSE 2drop `locales:default THEN ,
    DOES> to locale ;

    This one also seems to assume that it is only ever called in a context
    where LATEST does not return 0:

    : folding ( n -- )
    latest >namehm @ >hmcompile, @ swap
    next-section noname foldn: previous-section
    lastfold set-optimizer ;

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2026 CFP: http://www.euroforth.org/ef26/cfp.html
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Sep 18 10:42:08 2026
    From Newsgroup: comp.lang.forth

    In article <nnd$7e01eed4$7a4c0e58@adee5298750770bc>,
    Hans Bezemer <the.beez.speaks@gmail.com> wrote:
    <SNIP>
    What's next? PLACE-IN-STRING? APPEND-TO-STRING? As replacements for
    PLACE and +PLACE?
    They are too long for those fundamental words.
    Use $! and $+! .


    Ruvim
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Sep 18 11:04:10 2026
    From Newsgroup: comp.lang.forth

    In article <10btvtg$398cl$2@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    <SNIP>
    Probably, a better way would be to require systems to provide only
    standard words in `forth-wordlist`, and for programs to *explicitly*
    include a system-specific word list into the search order (if they need
    it). But many people don't like this approach.

    That would be actually insane. The brilliancy of the ciforth
    design that words constituting kernel words are actually useful, and
    many proposed words allow a short definition bases on those.
    One of the key decision that words are identified by a 'handle'
    and all properties are derived from this. The invention of
    "name token" is a recognition for this necessity.
    This decision originated in 1993 where we (FIG Holland)
    designed transputer forth.
    In this design there is no doubt what LATEST should do.
    It should give the handle for the word defined latest.
    No need for a plethora of names.

    name-token is a terrible misnomer, because the name is only
    a property of a dictionary entry identified by the handle.

    : aap ." We gaan naar Rome " ;
    LATEST ID.
    aap
    "noot" $, LATEST >NFA !
    LATEST ID.
    noot

    $, is used indirectly in : CONSTANT VARIABLE USER .
    It is insane to hide this or similar words.

    --
    Ruvim

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Fri Sep 18 11:13:02 2026
    From Newsgroup: comp.lang.forth

    In article <2026Sep17.174238@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires >>`last-name` instead of `latest-name`? Are there perhaps any examples?

    Gforth has a word LATEST with the specification:

    |'latest' ( - nt|0 ) gforth-0.6
    | If the most recent word defined in the current section has a name, nt
    |is its name token; otherwise, return 0.

    So the questions is: under what circumstances has the most recent
    word no name? This requires a ton of documentation.

    ciforth :
    LATEST returns the handle of the word most recently defined (CURRENT).
    It return zero if current is empty.

    - anton
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Fri Sep 18 15:37:21 2026
    From Newsgroup: comp.lang.forth

    On 2026-09-17 19:42, Anton Ertl wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?

    Gforth has a word LATEST with the specification:

    |'latest' ( - nt|0 ) gforth-0.6
    | If the most recent word defined in the current section has a name, nt
    |is its name token; otherwise, return 0.

    That's not quite last-name, but it's similar. It is used in the
    following contexts that handle the 0 and do not throw:

    : reveal ( -- ) \ gforth
    \G Put the current word in the wordlist current at the time of the
    \G header definition.
    latest ?dup-if \ the last word has a header
    dup >link @ 1 and
    if \ it is still hidden
    dup >link @ 1 xor ( nt wid )
    reveal!
    else
    drop
    then
    then ;

    : addressable ( -- ) \ gforth-internal
    \G Mark the last word (if named) as addressable
    latest IF addressable-mask lastflags or! THEN ;

    It seems, these two words handle the 0 not to bypass the empty
    compilation word list, but to support nameless definition (these cases
    are not distinguishable when using `latest`).

    E.g., if `latest-name` were used in `addressable`, then `addressable`
    would affect the latest named definition regardless of more recent
    nameless definitions. And using `addressable` when the compilation word
    list is empty would likely be an error that should be reported rather
    than ignored.



    Here we have a case that explicitly throws if the result is 0 (like
    your LATEST-NAME):

    : lastflags ( -- c-addr )
    \ the address of the flags byte in the last header
    \ aborts if the last defined word was headerless
    latest dup 0= abort" last word was nameless"
    >f+c ;

    And the following cases where LATEST is guaranteed not to return 0:

    : extra-section ( usize "name" -- ) \ gforth
    \G Define a new word @i{name} and create a section @i{s} with at
    \G least @i{usize} unused bytes.@* @i{Name} execution @code{(
    \G ... xt -- ... )}: When calling @i{name}, the current section is
    \G @i{c}. Switch the current section to be @i{s}, @i{execute} xt,
    \G then switch the current section back to @i{c}.
    section-desc + pagealigned
    create-section dup >extra-sections
    create , latest [: section-name ! ;] over @ section-execute
    does> ( xt -- )
    @ section-execute ;

    : Locale: ( "name" -- ) \ gforth-experimental
    \G Defines a new locale @i{l} with name @i{name} in
    \G @word{locales}.@* @i{name} execution: ( -- ) @i{l} becomes the
    \G current locale.@* For locales with names of the form
    \G @code{@i{X}_@i{Y}}, define @code{@i{X}} first in order to
    \G establish @code{@i{X}} as a fallback for @code{@i{X}_@i{Y}}.
    [: ['] locales >wordlist set-current
    `locales:program create-from reveal ;]
    current-execute here $[]saved 0 ,
    latest name>string '_' -scan dup IF
    ['] locales >wordlist find-name-in
    dup IF name>interpret >body ELSE drop `locales:default THEN
    ELSE 2drop `locales:default THEN ,
    DOES> to locale ;

    This one also seems to assume that it is only ever called in a context
    where LATEST does not return 0:

    : folding ( n -- )
    latest >namehm @ >hmcompile, @ swap
    next-section noname foldn: previous-section
    lastfold set-optimizer ;



    Other similar words:

    : latestxt ( -- xt ) \ gforth
    lastnt @ name>interpret ;


    `\G` (from "doc/makedoc.fs")


    That is, even in the system-specific examples, I don't see any profit
    from using `last-name ( -- nt|0 )` instead of `latest-name ( -- nt )`
    (if both are possible).

    In practice, `last-name ( -- nt|0 )` is extremely rarely needed.
    In few cases, a more low level `last-name-in ( wid -- nt|0 )` is sufficient.


    So I suggest renaming the more low-level word `latest-name-in`
    to `last-name-in`, to avoid similarity in names where the stack effect
    is not similar.



    --
    Ruvim

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Fri Sep 18 22:42:54 2026
    From Newsgroup: comp.lang.forth

    On 18/09/2026 9:37 pm, Ruvim wrote:
    On 2026-09-17 19:42, Anton Ertl wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    If you have the words:

    -a-a last-name-in ( wid -- nt|0 )
    -a-a last-name ( -- nt|0 )
    -a-a latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`?-a Are there perhaps any examples?

    Gforth has a word LATEST with the specification:

    |'latest' ( - nt|0-a ) gforth-0.6
    |-a-a If the most recent word defined in the current section has a name, nt >> |is its name token; otherwise, return 0.

    That's not quite last-name, but it's similar.-a It is used in the
    following contexts that handle the 0 and do not throw:

    : reveal ( -- ) \ gforth
    -a-a-a-a \G Put the current word in the wordlist current at the time of the >> -a-a-a-a \G header definition.
    -a-a-a-a latest ?dup-if \ the last word has a header
    -a-a-a-a-a-a-a-a dup >link @ 1 and
    -a-a-a-a-a-a-a-a if \ it is still hidden
    -a-a-a-a-a-a-a-a-a-a-a-a dup >link @ 1 xor-a-a-a-a-a-a-a-a-a-a ( nt wid )
    -a-a-a-a-a-a-a-a-a-a-a-a reveal!
    -a-a-a-a-a-a-a-a else
    -a-a-a-a-a-a-a-a-a-a-a-a drop
    -a-a-a-a-a-a-a-a then
    -a-a-a-a then ;

    : addressable ( -- ) \ gforth-internal
    -a-a-a-a \G Mark the last word (if named) as addressable
    -a-a-a-a latest IF-a addressable-mask lastflags or!-a THEN ;

    It seems, these two words handle the 0 not to bypass the empty compilation word list, but to support nameless definition (these cases are not distinguishable when using `latest`).

    E.g., if `latest-name` were used in `addressable`, then `addressable` would affect the latest named definition regardless of more recent nameless definitions. And using `addressable` when the compilation word list is empty would likely be an error that should be reported rather than ignored.

    I use a variable which suffices my needs:

    LAST ( -- a-addr ) S

    A 2VARIABLE containing the name field and execution token address
    of the latest definition.

    LAST @ ( nfa )
    LAST 2@ ( xt nfa )

    For :NONAMEs nfa points to a 0000 address which signals .ID to print '[noname]' should it be specifically asked. It never shows in 'WORDS' as there's no actual
    header. Otherwise nfa points to the last created header whatever that happened to be. At this point my system is too far from the ANS/200x wordlist model (I cut
    most of it out) for me to care what is standardized.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From peter@peter.noreply@tin.it to comp.lang.forth on Fri Sep 18 20:45:35 2026
    From Newsgroup: comp.lang.forth

    On Thu, 17 Sep 2026 15:20:54 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2025-10-05 15:25, Ruvim wrote:
    I have updated my proposal on the `latest-name` and `latest-name-in` words. Essentially, I have added a lot of rationale and one very
    portable reference implementation.

    See at <https://forth-standard.org/proposals/new-words-latest-name-and- latest-name-in?hideDiff#reply-1573>

    Please let me know if you have any questions or suggestions on this regard. Note that this webpage contains previous versions of the
    proposal above the specified anchor.


    There is a certain tension between the return type `nt|0` in one case
    and `nt` in the other.


    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?

    In ntf64/lxf64 I have a variable LAST that contains the NT of the last
    defined word. It is global and not connected to a wid and will always
    have a valid NT stored. It can never be 0.
    All definitions even noname: have a header with a name, even the does>
    part of a crate does> construct is a definition with a header.
    [: ;] quotations are compiled into the hosting word and do not
    have a header. This can change in the future.

    I would define
    : last-name last @ ;
    : latest-name last @ ;

    last-name-in is not easily defined in my system

    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    BR
    Peter


    --
    Ruvim



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sat Sep 19 00:00:58 2026
    From Newsgroup: comp.lang.forth

    In article <6aad31ce$1@news.ausics.net>, dxf <dxforth@gmail.com> wrote:
    On 18/09/2026 9:37 pm, Ruvim wrote:
    On 2026-09-17 19:42, Anton Ertl wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    If you have the words:

    -a-a last-name-in ( wid -- nt|0 )
    -a-a last-name ( -- nt|0 )
    -a-a latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`?-a Are there perhaps any examples? >>>
    Gforth has a word LATEST with the specification:

    |'latest' ( - nt|0-a ) gforth-0.6
    |-a-a If the most recent word defined in the current section has a name, nt >>> |is its name token; otherwise, return 0.

    That's not quite last-name, but it's similar.-a It is used in the
    following contexts that handle the 0 and do not throw:

    : reveal ( -- ) \ gforth
    -a-a-a-a \G Put the current word in the wordlist current at the time of the >>> -a-a-a-a \G header definition.
    -a-a-a-a latest ?dup-if \ the last word has a header
    -a-a-a-a-a-a-a-a dup >link @ 1 and
    -a-a-a-a-a-a-a-a if \ it is still hidden
    -a-a-a-a-a-a-a-a-a-a-a-a dup >link @ 1 xor-a-a-a-a-a-a-a-a-a-a ( nt wid ) >>> -a-a-a-a-a-a-a-a-a-a-a-a reveal!
    -a-a-a-a-a-a-a-a else
    -a-a-a-a-a-a-a-a-a-a-a-a drop
    -a-a-a-a-a-a-a-a then
    -a-a-a-a then ;

    : addressable ( -- ) \ gforth-internal
    -a-a-a-a \G Mark the last word (if named) as addressable
    -a-a-a-a latest IF-a addressable-mask lastflags or!-a THEN ;

    It seems, these two words handle the 0 not to bypass the empty compilation word list, but to support nameless definition (these cases are not distinguishable when using `latest`).

    E.g., if `latest-name` were used in `addressable`, then `addressable` would affect the latest named definition regardless of more recent nameless definitions. And using `addressable` when the compilation word list is empty would likely be an error that should be reported rather than ignored.

    I use a variable which suffices my needs:

    LAST ( -- a-addr ) S

    A 2VARIABLE containing the name field and execution token address
    of the latest definition.

    LAST @ ( nfa )
    LAST 2@ ( xt nfa )

    You are almost there. LAST or LATEST should be the address of a structure that allows to arrive at the behaviour ("xt") , name, data, high level code, immediate
    flags or whatever.
    IMMEDIATE patches the latest definition, not the nfa, not the xt.

    For :NONAMEs nfa points to a 0000 address which signals .ID to print '[noname]'
    should it be specifically asked. It never shows in 'WORDS' as there's no actual
    header. Otherwise nfa points to the last created header whatever that happened
    to be. At this point my system is too far from the ANS/200x wordlist model (I cut
    most of it out) for me to care what is standardized.

    Either you support anonymous behaviour (lambda) that can be attached to a dictionary entry or you don't. If :NONAME generates a real lambda then
    there is no header, so no nfa that points to anything.
    The alternative are

    Or :noname definitions have a regular header that is patched.
    : :NONAME ": NONAME" EVALUATE &; PARSE EVALUATE
    0 LATEST >NFA ! ; \ Overwrite the preliminary ":NONAME"

    Either:
    CREATE AAP

    { 1 2 3 } 'AAP 2 CELLS MOVE \ Anonymous behaviour is filled in
    SEE AAP
    : AAP
    1 2 0000,0000,0000,0003
    ;

    Or a code example (DUP)
    HERE POP, AX PUSH, AX PUSH, AX NEXT, \ code lambda
    'AAP >CFA !


    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Sat Sep 19 10:33:50 2026
    From Newsgroup: comp.lang.forth

    On 2026-09-18 22:45, peter wrote:
    On Thu, 17 Sep 2026 15:20:54 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2025-10-05 15:25, Ruvim wrote:
    I have updated my proposal on the `latest-name` and `latest-name-in`
    words. Essentially, I have added a lot of rationale and one very
    portable reference implementation.

    See at <https://forth-standard.org/proposals/new-words-latest-name-and-
    latest-name-in?hideDiff#reply-1573>

    Please let me know if you have any questions or suggestions on this
    regard. Note that this webpage contains previous versions of the
    proposal above the specified anchor.


    There is a certain tension between the return type `nt|0` in one case
    and `nt` in the other.


    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?

    In ntf64/lxf64 I have a variable LAST that contains the NT of the last defined word. It is global and not connected to a wid and will always
    have a valid NT stored. It can never be 0.

    All definitions even noname: have a header with a name, even the does>
    part of a crate does> construct is a definition with a header.

    That does not matter for a standard program, if these headers are not available via `traverse-wordlist`.


    [: ;] quotations are compiled into the hosting word and do not
    have a header. This can change in the future.

    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823

    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;



    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be
    easily implemented in typical Forth systems.


    --
    Ruvim

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From peter@peter.noreply@tin.it to comp.lang.forth on Sat Sep 19 09:11:56 2026
    From Newsgroup: comp.lang.forth

    On Sat, 19 Sep 2026 10:33:50 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-18 22:45, peter wrote:
    On Thu, 17 Sep 2026 15:20:54 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2025-10-05 15:25, Ruvim wrote:
    I have updated my proposal on the `latest-name` and `latest-name-in`
    words. Essentially, I have added a lot of rationale and one very
    portable reference implementation.

    See at <https://forth-standard.org/proposals/new-words-latest-name-and- >>> latest-name-in?hideDiff#reply-1573>

    Please let me know if you have any questions or suggestions on this
    regard. Note that this webpage contains previous versions of the
    proposal above the specified anchor.


    There is a certain tension between the return type `nt|0` in one case
    and `nt` in the other.


    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?

    In ntf64/lxf64 I have a variable LAST that contains the NT of the last defined word. It is global and not connected to a wid and will always
    have a valid NT stored. It can never be 0.

    All definitions even noname: have a header with a name, even the does>
    part of a crate does> construct is a definition with a header.

    That does not matter for a standard program, if these headers are not available via `traverse-wordlist`.

    They are!


    [: ;] quotations are compiled into the hosting word and do not
    have a header. This can change in the future.

    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823

    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;

    This requires that new definitions reside at higher memory.
    This might not be true in a future release.




    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be
    easily implemented in typical Forth systems.

    My systems are not typical but they try very hard to be standard
    compliant!

    I need to look up your proposal to understand why these words
    are important and what use they can have.

    BR
    Peter

    --
    Ruvim



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Sat Sep 19 12:53:33 2026
    From Newsgroup: comp.lang.forth

    On 2026-09-19 11:11, peter wrote:
    On Sat, 19 Sep 2026 10:33:50 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-18 22:45, peter wrote:
    [...]
    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823

    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;

    This requires that new definitions reside at higher memory.
    This might not be true in a future release.

    Yes, that is a system-specific implementation.

    A possible solution is to allocate one additional cell within the wid
    data structure to store nt of the word most recently added to the word
    list. NB: the words `forget` and children of `marker` should restore
    that value if they remove words from a word list.


    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be
    easily implemented in typical Forth systems.

    My systems are not typical but they try very hard to be standard
    compliant!

    I need to look up your proposal to understand why these words
    are important and what use they can have.

    <https://forth-standard.org/proposals/new-words-latest-name-and-latest-name-in?hideDiff#reply-1573>

    I look forward to your feedback.


    --
    Ruvim

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From peter@peter.noreply@tin.it to comp.lang.forth on Sat Sep 19 16:30:44 2026
    From Newsgroup: comp.lang.forth

    On Sat, 19 Sep 2026 12:53:33 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-19 11:11, peter wrote:
    On Sat, 19 Sep 2026 10:33:50 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-18 22:45, peter wrote:
    [...]
    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823

    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;

    This requires that new definitions reside at higher memory.
    This might not be true in a future release.

    Yes, that is a system-specific implementation.

    A possible solution is to allocate one additional cell within the wid
    data structure to store nt of the word most recently added to the word
    list. NB: the words `forget` and children of `marker` should restore
    that value if they remove words from a word list.


    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be
    easily implemented in typical Forth systems.

    My systems are not typical but they try very hard to be standard
    compliant!

    I need to look up your proposal to understand why these words
    are important and what use they can have.

    <https://forth-standard.org/proposals/new-words-latest-name-and-latest-name-in?hideDiff#reply-1573>

    I look forward to your feedback.

    Ok I see how you use it. In both those cases my global last would also have worked.
    The structure in its own vocabulary is nice as it hides the definitions in its own wid.
    It would not work out so well in my system as I have a default hashtable size of 251
    buckets!
    ' bar is foo Is much better in my opinion. I do not like to hide operations like that.

    In any way the implementation of traversing the worlist works in my systems. If that
    changes I could find another way to save the last NT per wid.

    BR
    Peter

    --
    Ruvim



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sat Sep 19 16:37:56 2026
    From Newsgroup: comp.lang.forth

    In article <118lace$1ud29$1@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2026-09-18 22:45, peter wrote:
    On Thu, 17 Sep 2026 15:20:54 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2025-10-05 15:25, Ruvim wrote:
    I have updated my proposal on the `latest-name` and `latest-name-in`
    words. Essentially, I have added a lot of rationale and one very
    portable reference implementation.

    See at <https://forth-standard.org/proposals/new-words-latest-name-and- >>>> latest-name-in?hideDiff#reply-1573>

    Please let me know if you have any questions or suggestions on this
    regard. Note that this webpage contains previous versions of the
    proposal above the specified anchor.


    There is a certain tension between the return type `nt|0` in one case
    and `nt` in the other.


    If you have the words:

    last-name-in ( wid -- nt|0 )
    last-name ( -- nt|0 )
    latest-name ( -- nt )

    Do you have any idea in which cases the standard program requires
    `last-name` instead of `latest-name`? Are there perhaps any examples?

    In ntf64/lxf64 I have a variable LAST that contains the NT of the last
    defined word. It is global and not connected to a wid and will always
    have a valid NT stored. It can never be 0.

    All definitions even noname: have a header with a name, even the does>
    part of a crate does> construct is a definition with a header.

    That does not matter for a standard program, if these headers are not >available via `traverse-wordlist`.


    [: ;] quotations are compiled into the hosting word and do not
    have a header. This can change in the future.

    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823

    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;



    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be
    easily implemented in typical Forth systems.

    Don't hide your tools (Moore). I agree. If an implementations of
    a language is not good for programming, it is good for nothing.
    The "internal" words of an implementation should be helpful to
    generate advanced features.

    Going the CHAR [CHAR] INVERT 0= ] ['] route, inventing increasing clever
    names and a plethora of them ... Taking care not to thread on
    existing implementations names ...
    Trying to portably implement essential features of a language leads
    nowhere. Maybe accepting academic papers.

    There is no way a tight specification of LAST LAST-NAME LATEST
    LAST-NT can be formulated in the context of current standards.
    What Anton Ertl did came closest.

    --
    Ruvim

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Sun Sep 20 12:18:31 2026
    From Newsgroup: comp.lang.forth

    On 2026-09-19 18:30, peter wrote:
    On Sat, 19 Sep 2026 12:53:33 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-19 11:11, peter wrote:
    On Sat, 19 Sep 2026 10:33:50 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-18 22:45, peter wrote:
    [...]
    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823

    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;

    This requires that new definitions reside at higher memory.
    This might not be true in a future release.

    Yes, that is a system-specific implementation.

    A possible solution is to allocate one additional cell within the wid
    data structure to store nt of the word most recently added to the word
    list. NB: the words `forget` and children of `marker` should restore
    that value if they remove words from a word list.


    LAST is used in reveal, immediate and macro. It should not be used
    directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be
    easily implemented in typical Forth systems.

    My systems are not typical but they try very hard to be standard
    compliant!

    I need to look up your proposal to understand why these words
    are important and what use they can have.

    <https://forth-standard.org/proposals/new-words-latest-name-and-latest-name-in?hideDiff#reply-1573>

    I look forward to your feedback.

    Ok I see how you use it. In both those cases my global last would also have worked.

    There are some differences. Take a look at an example:

    struct: foo
    \ here, `latest-name` throws an exception
    field a \ here, `latest-name` returns nt for "a"
    field b \ here, `latest-name` returns nt for "a"
    ;struct
    \ here, `latest-name` returns nt for "foo"

    That is, after translating of the block, `latest-name` returns nt for
    `foo`, because other words are created in a separate word list. But
    your `last @` returns nt for some auto-created internal word.



    The structure in its own vocabulary is nice as it hides the definitions in its own wid.
    It would not work out so well in my system as I have a default hashtable size of 251
    buckets!
    ' bar is foo Is much better in my opinion. I do not like to hide operations like that.

    In any way the implementation of traversing the worlist works in my systems. If that
    changes I could find another way to save the last NT per wid.

    Excellent!


    --
    Ruvim

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From peter@peter.noreply@tin.it to comp.lang.forth on Sun Sep 20 11:08:17 2026
    From Newsgroup: comp.lang.forth

    On Sun, 20 Sep 2026 12:18:31 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-19 18:30, peter wrote:
    On Sat, 19 Sep 2026 12:53:33 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-19 11:11, peter wrote:
    On Sat, 19 Sep 2026 10:33:50 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-18 22:45, peter wrote:
    [...]
    I would define
    : last-name last @ ;
    : latest-name last @ ;

    Such an implementation does not meet the proposed requirements.


    last-name-in is not easily defined in my system

    The following implementation works in Linux/FORTH Version 1.6-982-823 >>>>
    : umax ( u1 u2 -- u1|u2 ) 2dup u< if swap then drop ;
    : (last-name-in) ( u1 u2 -- u1|u2 true ) umax true ;

    : last-name-in ( wid -- nt|0 )
    >r 0 ['] (last-name-in) r> traverse-wordlist
    ;

    This requires that new definitions reside at higher memory.
    This might not be true in a future release.

    Yes, that is a system-specific implementation.

    A possible solution is to allocate one additional cell within the wid
    data structure to store nt of the word most recently added to the word
    list. NB: the words `forget` and children of `marker` should restore
    that value if they remove words from a word list.


    LAST is used in reveal, immediate and macro. It should not be used >>>>> directly in user code

    Yes, sure. That's why I propose standardizing new words, which can be >>>> easily implemented in typical Forth systems.

    My systems are not typical but they try very hard to be standard
    compliant!

    I need to look up your proposal to understand why these words
    are important and what use they can have.

    <https://forth-standard.org/proposals/new-words-latest-name-and-latest-name-in?hideDiff#reply-1573>

    I look forward to your feedback.

    Ok I see how you use it. In both those cases my global last would also have worked.

    There are some differences. Take a look at an example:

    struct: foo
    \ here, `latest-name` throws an exception
    field a \ here, `latest-name` returns nt for "a"
    field b \ here, `latest-name` returns nt for "a"
    ;struct
    \ here, `latest-name` returns nt for "foo"

    That is, after translating of the block, `latest-name` returns nt for
    `foo`, because other words are created in a separate word list. But
    your `last @` returns nt for some auto-created internal word.

    Yes I see now that these are completely different words. LAST is used
    during header creation of a new word. It is then used by reveal to
    make the new word findable in the current wordlist.
    Your latest-name cannot be used for that.
    LAST is also used for immediate and macro to set that function!

    I think your proposal could be clearer. It mentions latest, last @
    and latestxt as examples of known internal words. But your proposal
    is for a new word that has a different function.

    BR
    Peter


    The structure in its own vocabulary is nice as it hides the definitions in its own wid.
    It would not work out so well in my system as I have a default hashtable size of 251
    buckets!
    ' bar is foo Is much better in my opinion. I do not like to hide operations like that.

    In any way the implementation of traversing the worlist works in my systems. If that
    changes I could find another way to save the last NT per wid.

    Excellent!


    --
    Ruvim



    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Sun Sep 20 18:25:26 2026
    From Newsgroup: comp.lang.forth

    On 2026-09-20 13:08, peter wrote:
    On Sun, 20 Sep 2026 12:18:31 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-19 18:30, peter wrote:
    On Sat, 19 Sep 2026 12:53:33 +0400
    Ruvim <ruvim.pinka@gmail.com> wrote:

    On 2026-09-19 11:11, peter wrote:
    I need to look up your proposal to understand why these words
    are important and what use they can have.

    <https://forth-standard.org/proposals/new-words-latest-name-and-latest-name-in?hideDiff#reply-1573>

    I look forward to your feedback.

    Ok I see how you use it. In both those cases my global last would also have worked.

    There are some differences. Take a look at an example:

    struct: foo
    \ here, `latest-name` throws an exception
    field a \ here, `latest-name` returns nt for "a"
    field b \ here, `latest-name` returns nt for "a"
    typo: certainly, nt for "b"

    ;struct
    \ here, `latest-name` returns nt for "foo"

    That is, after translating of the block, `latest-name` returns nt for
    `foo`, because other words are created in a separate word list. But
    your `last @` returns nt for some auto-created internal word.

    Yes I see now that these are completely different words. LAST is used
    during header creation of a new word. It is then used by reveal to
    make the new word findable in the current wordlist.
    Your latest-name cannot be used for that.

    Yes. Thus, this word does not prevent the Forth system from creating a
    name token (nt) only on semicolon `;`. OTOH, some systems insert (under
    the hood) a new nt into the compilation word list on `:`, but this nt
    remains inaccessible via either `traverse-wordlist` or `latest-name`
    until the definition is fully created.


    LAST is also used for immediate and macro to set that function!

    I think your proposal could be clearer. It mentions latest, last @
    and latestxt as examples of known internal words. But your proposal
    is for a new word that has a different function.

    I will add that, thanks!


    --
    Ruvim

    --- Synchronet 3.22a-Linux NewsLink 1.2