Re: May the numbers speak - supplement

Liste des GroupesRevenir à cl forth 
Sujet : Re: May the numbers speak - supplement
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 13. Jun 2025, 05:00:10
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <675461196122a89d9f59b3dba3f88540b604e1ea@i2pn2.org>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 13/06/2025 6:42 am, Paul Rubin wrote:
mhx@iae.nl (mhx) writes:
It doesn't do the same thing. It isn't faster, which points out
the '60 *' and 'M* D+' are not the limiting factors.
 
Oh I copied the interface from another post, didn't realize it was
supposed to convert to seconds.  I didn't care about the speed since any
slowness in any of these versions can be blamed on the compiler ;).
Here is another version:
 
variable p
: advance 1 p +! ;
: digit ( -- n ) p @ c@ '0' - advance ;
: 2digit ( -- n ) digit 10 * digit + advance ; \ skips trailing colon
: hms ( a u -- n ) drop p !   2digit 60 * 2digit + 60 * 2digit + ;
: test clearstack  s" 12:34:56" hms ;
 
test .s

At least the variable is being used across words as opposed to within.
One may debate whether the factoring was worth it.


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