In article <100sirh$lm0v$
[email protected]>,
Ruvim <
[email protected]> 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)