Re: Parsing timestamps?

Liste des GroupesRevenir à cl forth 
Sujet : Re: Parsing timestamps?
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 10. Jun 2025, 03:31:51
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <70a3014f99baf5e43b32e1320d7b8cd482be04c1@i2pn2.org>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 10/06/2025 6:00 am, LIT wrote:
...
Stack jugglery means wasting CPU cycles for
moving the bytes around - it's contrproductive.
Variables have been invented to be used. They're
useful, if you didn't notice, or if they didn't
tell you that in your college, or wherever.

Forth uses variables in the global sense and this works well.
Variables at the word level is often an indication something is
wrong.  Locals users rarely justify on grounds of performance as
experience over the years has shown time and again well-written
stack code is both shorter and faster.  The temptation is to
write one routine that does it all and this is where variables
and 'stack juggling' can sneak in.  OTOH some implementations
are just neater and its a matter of finding them!

: HMS>SEC ( s m h -- ud )  3600 um*  2swap  60 *  +  0  d+ ;

\ Parse HH:MM:SS or free-form  ref: sjack
: >HMS ( a u -- sec min hr )
  2>r  0 0 0  2r>  begin
    /int  5 -roll  rot drop  dup while  [char] : ?skip
  repeat 2drop ;

\ Parse HMS string returning #csecs
: /HMS ( a u -- ud )  >hms hms>sec  100 mu* ;



Date Sujet#  Auteur
6 Oct 24 * Parsing timestamps?56dxf
6 Oct 24 +* Re: Parsing timestamps?19mhx
6 Oct 24 i+* Re: Parsing timestamps?3dxf
6 Oct 24 ii`* Re: Parsing timestamps?2dxf
7 Oct 24 ii `- Re: Parsing timestamps?1dxf
7 Jun13:38 i`* Re: Parsing timestamps?15B. Pym
7 Jun15:36 i +* Re: Parsing timestamps?12dxf
7 Jun18:07 i i`* Re: Parsing timestamps?11LIT
8 Jun03:38 i i `* Re: Parsing timestamps?10dxf
9 Jun14:21 i i  `* Re: Parsing timestamps?9Hans Bezemer
9 Jun14:34 i i   `* Re: Parsing timestamps?8LIT
9 Jun20:31 i i    `* Re: Parsing timestamps?7Hans Bezemer
9 Jun21:00 i i     `* Re: Parsing timestamps?6LIT
10 Jun03:31 i i      +* Re: Parsing timestamps?4dxf
10 Jun08:32 i i      i+* Re: Parsing timestamps?2mhx
10 Jun09:30 i i      ii`- Re: Parsing timestamps?1dxf
10 Jun11:10 i i      i`- Re: Parsing timestamps?1LIT
10 Jun10:52 i i      `- Re: Parsing timestamps?1LIT
9 Jun13:34 i +- Re: Parsing timestamps?1B. Pym
10 Jun10:18 i `- Re: Parsing timestamps?1B. Pym
6 Oct 24 +* Re: Parsing timestamps?5Ruvim
6 Oct 24 i`* Re: Parsing timestamps?4dxf
6 Oct 24 i `* Re: Parsing timestamps?3Ruvim
6 Oct 24 i  +- Re: Parsing timestamps?1Ruvim
6 Oct 24 i  `- Re: Parsing timestamps?1Ruvim
6 Oct 24 +* Re: Parsing timestamps?6FFmike
6 Oct 24 i`* Re: Parsing timestamps?5FFmike
7 Oct 24 i `* Re: Parsing timestamps?4dxf
7 Oct 24 i  `* Re: Parsing timestamps?3FFmike
7 Oct 24 i   `* Re: Parsing timestamps?2dxf
7 Oct 24 i    `- Re: Parsing timestamps?1FFmike
6 Oct 24 +* Re: Parsing timestamps?2Anthony Howe
7 Oct 24 i`- Re: Parsing timestamps?1dxf
7 Oct 24 +* Re: Parsing timestamps?9albert
7 Oct 24 i`* Re: Parsing timestamps?8dxf
7 Oct 24 i `* Re: Parsing timestamps?7sjack
8 Oct 24 i  `* Re: Parsing timestamps?6dxf
8 Oct 24 i   +* Re: Parsing timestamps?3Ahmed
8 Oct 24 i   i+- Re: Parsing timestamps?1dxf
8 Oct 24 i   i`- Re: Parsing timestamps?1sjack
8 Oct 24 i   `* Re: Parsing timestamps?2sjack
9 Oct 24 i    `- Re: Parsing timestamps?1dxf
8 Oct 24 +* Re: Parsing timestamps?3albert
8 Oct 24 i`* Re: Parsing timestamps?2dxf
8 Oct 24 i `- Re: Parsing timestamps?1Ahmed
9 Oct 24 +* Re: Parsing timestamps?4alaa
10 Oct 24 i+* Re: Parsing timestamps?2dxf
10 Oct 24 ii`- Re: Parsing timestamps?1alaa
16 Oct 24 i`- Re: Parsing timestamps?1Hans Bezemer
18 Oct 24 `* Re: Parsing timestamps?7Gerry Jackson
19 Oct 24  `* Re: Parsing timestamps?6dxf
28 Oct 24   `* Re: Parsing timestamps?5Hans Bezemer
29 Oct 24    `* Re: Parsing timestamps?4dxf
29 Oct 24     `* Re: Parsing timestamps?3Hans Bezemer
30 Oct 24      `* Re: Parsing timestamps?2dxf
31 Oct 24       `- Re: Parsing timestamps?1dxf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal