• Re: Naming 'n' instances or repetitions

    From Anton Ertl@21:1/5 to dxf on Thu May 22 07:40:11 2025
    dxf <dxforth@gmail.com> writes:
    In DX-Forth I have:

    NHOLD (H.N)

    Maybe your NHOLD is the same as the standard HOLDS:

    |6.2.1675 HOLDS CORE EXT ( c-addr u -- )
    |
    |Adds the string represented by c-addr u to the pictured numeric output |string. An ambiguous condition exists if HOLDS executes outside of a
    |<# #> delimited number conversion.

    <https://forth-standard.org/standard/core/HOLDS>

    - 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 2023 proceedings: http://www.euroforth.org/ef23/papers/
    EuroForth 2024 proceedings: http://www.euroforth.org/ef24/papers/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From albert@spenarnc.xs4all.nl@21:1/5 to ruvim.pinka@gmail.com on Sat May 24 21:45:45 2025
    In article <100sirh$lm0v$2@dont-email.me>,
    Ruvim <ruvim.pinka@gmail.com> wrote:
    On 2025-05-22 07:34, dxf wrote:
    I've noticed two ways of naming things 'done n times'.

    In SwiftForth there is:

    (.0) (H.0)

    which equate to executing '#' 'n' times.

    It's not clear to me why '0' was used though '0' appears in forth naming
    conventions meaning 'initialization'.

    In VFX Forth (and perhaps others) there is:

    NDROP

    where 'n' indicates number of executions.


    In the word names like `ndrop`, `n>r`, `nr>` I consider `n` as an
    indicator of the data type on which these words operate.

    Namely, it is an indicator of the data type ( +n.len*x +n.len ), that is
    a dependent pair type.


    I agree with as n counts, # is better.



    Other examples.

    In the words like `2swap`, `2>r`, `2drop`, `2!`, etc, `2` is an
    indicator of the data type ( 2*x ), that is an unspecified pair ( x x ).

    I don't like words that start with a digit. pswap p! p>r etc. is better.

    But in the word `2/` (and non-standard `2+`), `2` is not a data type >indicator. Therefore, this name conflicts and is best avoided/eliminated.
    2/ is misleading because is is not the same as 2 / .
    Because they are actually shift operators >>A and <<A are better.
    (Because actual normal shifts are << and >> ).



    In the words like `u/`, `umin`, `umax`, etc, `u` is an indicator of the
    data type ( u ), that is unsigned single-cell integer number.

    In the words like `d+`, `dnegate`, etc, `d` is an indicator of the data
    type ( d ), that is signed double-cell integer number.

    Agreed.



    See more at https://github.com/ForthHub/discussion/discussions/186

    Now go design your own language. (I did).

    <SNIP>

    --
    Ruvim

    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)