Re: May the numbers speak - supplement

Liste des GroupesRevenir à cl forth 
Sujet : Re: May the numbers speak - supplement
De : the.beez.speaks (at) *nospam* gmail.com (Hans Bezemer)
Groupes : comp.lang.forth
Date : 13. Jun 2025, 13:44:18
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$60801ebf$673609a7@27f3ceb479661625>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 13-06-2025 06:46, dxf wrote:
On 13/06/2025 8:24 am, B. Pym wrote:
: keep { lo hi adr len } lo adr len ;
: get { adr len } 0. adr len >number keep 1 /string ;
: hms ( adr len -- h m s) get get get 2drop ;
: test clearstack s" 12:34:56" hms ;
 Not worth the locals IMO.  OTOH I guarantee (number) will be re-used.
 : (number) ( adr len -- ud adr' len' )  0. 2swap >number ;
: get ( adr len -- u adr' len' )  (number) rot drop 1 /string ;
: hms ( adr len -- h m s)  get get get 2drop ;
: test  clearstack s" 12:34:56" hms ;
 
That's why I consider the use of global variables in library functions worse than locals. You're polluting the namespace.
In 4tH I can introduce and remove them from the namespace within the same module. That's done by simply kicking them individually (and not the whole shebang after it) from the symbol table.
But still, I don't like to introduce new symbols. What if the user had his own library - and didn't take those precautions? He'll be wondering "Why is this thing complaining - instead of compiling?"
That's also the reason I didn't define stuff like "ERROR" - since that is more likely to be used by end-users. Also guilty: I haven't documented all "publics" from all libs - so there is nothing to fall back on. On the other hand - I'd like to keep my sanity. More things documented means more things to maintain.
Hans Bezemer

Date Sujet#  Auteur
11 Jun 25 * May the numbers speak32LIT
11 Jun 25 +* Re: May the numbers speak25LIT
11 Jun 25 i`* Re: May the numbers speak - supplement24LIT
11 Jun 25 i `* Re: May the numbers speak - supplement23minforth
12 Jun 25 i  `* Re: May the numbers speak - supplement22dxf
12 Jun 25 i   `* Re: May the numbers speak - supplement21Paul Rubin
12 Jun 25 i    +- Re: May the numbers speak - supplement1LIT
12 Jun 25 i    +* Re: May the numbers speak - supplement8mhx
12 Jun 25 i    i`* Re: May the numbers speak - supplement7Paul Rubin
12 Jun 25 i    i +* Re: May the numbers speak - supplement5mhx
12 Jun 25 i    i i`* Re: May the numbers speak - supplement4Paul Rubin
13 Jun 25 i    i i `* Re: May the numbers speak - supplement3mhx
13 Jun 25 i    i i  `* Re: May the numbers speak - supplement2Paul Rubin
13 Jun 25 i    i i   `- Re: May the numbers speak - supplement1mhx
13 Jun 25 i    i `- Re: May the numbers speak - supplement1dxf
12 Jun 25 i    +- Re: May the numbers speak - supplement1ahmed
12 Jun 25 i    +- Re: May the numbers speak - supplement1minforth
12 Jun 25 i    +* Re: May the numbers speak - supplement2B. Pym
12 Jun 25 i    i`- Re: May the numbers speak - supplement1Paul Rubin
12 Jun 25 i    +- Re: May the numbers speak - supplement1peter
12 Jun 25 i    `* Re: May the numbers speak - supplement6B. Pym
13 Jun 25 i     `* Re: May the numbers speak - supplement5dxf
13 Jun 25 i      +* Re: May the numbers speak - supplement3Hans Bezemer
13 Jun 25 i      i`* Re: May the numbers speak - supplement2Paul Rubin
14 Jun 25 i      i `- Re: May the numbers speak - supplement1dxf
15 Jun 25 i      `- Re: May the numbers speak - supplement1dxf
11 Jun 25 `* Re: May the numbers speak6dxf
11 Jun 25  `* Re: May the numbers speak5Hans Bezemer
12 Jun 25   +- Re: May the numbers speak1dxf
12 Jun 25   `* Re: May the numbers speak3sean
12 Jun 25    +- Re: May the numbers speak1mhx
12 Jun 25    `- Re: May the numbers speak1minforth

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal