Re: Naming 'n' instances or repetitions

Liste des GroupesRevenir à cl forth 
Sujet : Re: Naming 'n' instances or repetitions
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forth
Date : 24. May 2025, 20:45:45
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$5c42a5a4$300a1fd4@3977542249399dd6>
References : 1 2
User-Agent : trn 4.0-test77 (Sep 1, 2010)
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.

Date Sujet#  Auteur
22 May 25 * Naming 'n' instances or repetitions9dxf
22 May 25 +* Re: Naming 'n' instances or repetitions2Anton Ertl
22 May 25 i`- Re: Naming 'n' instances or repetitions1dxf
23 May 25 +- Re: Naming 'n' instances or repetitions1dxf
23 May 25 +* Re: Naming 'n' instances or repetitions2Hans Bezemer
24 May 25 i`- Re: Naming 'n' instances or repetitions1dxf
24 May 25 `* Re: Naming 'n' instances or repetitions3Ruvim
24 May 25  +- Re: Naming 'n' instances or repetitions1albert
25 May 25  `- Re: Naming 'n' instances or repetitions1dxf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal