Re: Naming 'n' instances or repetitions

Liste des GroupesRevenir à cl forth 
Sujet : Re: Naming 'n' instances or repetitions
De : the.beez.speaks (at) *nospam* gmail.com (Hans Bezemer)
Groupes : comp.lang.forth
Date : 23. May 2025, 12:45:38
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$26a91801$7a2db6c0@f68bf40b4b8d025f>
References : 1
User-Agent : Mozilla Thunderbird
On 22-05-2025 05: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 DX-Forth I have:
    NHOLD (H.N)
 mainly because I couldn't think of anything else but willing to change
if there were a consensus.
 Does anyone have knowledge on the matter or conventions etc.?
I consulted "Thinking Forth", but there's nothing directly relevant there. What I *DO* tend to do is to take a hash (#) as an indicator for "number". It can be positional (ERROR#), quantum (#ELEMENTS) - unless it is a quantum "per" thing (/ELEMENT).
It has to be a "fixed" quantum though. E.g. if there was no such thing as LEAVE or UNLOOP, I'd have no problems using a word like #DO - and something like #MOVE or #FILL wouldn't get any criticism from me too.
So, if I'd have to drop a number of elements I'd call it #DROP. The problem I have with "N" as a prefix is that it might be confusing. E.g. NEAT is a boolean for something cool - or the number of times something is eaten?
Hans Bezemer

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