Re: Reverse SCAN SPLIT

Liste des GroupesRevenir à cl forth 
Sujet : Re: Reverse SCAN SPLIT
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 07. Oct 2024, 12:22:57
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <8195b3d00499f82168a805aaa3a0be86097a0cc4@i2pn2.org>
References : 1 2
User-Agent : Mozilla Thunderbird
On 7/10/2024 9:02 pm, Ruvim wrote:
...
Why do you prefer the order ( u.hour u.min u.sec ) rather than ( u.sec u.min u.hour ) ?
 
The later order makes code simpler in (1) and (2), also, it follows the order of parameters in `TIME&DATE`.
 
Moreover, if you want to convert three components to seconds, you need to reverse their order again:
 
: time3-to-seconds ( u.hour u.min u.sec -- u.sec-total )
  swap rot  60 * + 60 * +
;
 
If the order of parameters is reversed, the above definition takes a simpler form:
 
: time3-to-seconds ( u.sec u.min u.hour -- u.sec-total )
  60 * + 60 * +
;

I thought it would be easier to convert to total secs (on 16-bit it has to be a double).
But perhaps not.


Date Sujet#  Auteur
7 Oct 24 * Reverse SCAN SPLIT18dxf
7 Oct 24 +* Re: Reverse SCAN SPLIT6Ahmed
7 Oct 24 i`* Re: Reverse SCAN SPLIT5Ahmed
7 Oct 24 i `* Re: Reverse SCAN SPLIT4dxf
7 Oct 24 i  `* Re: Reverse SCAN SPLIT3Ahmed
8 Oct 24 i   `* Re: Reverse SCAN SPLIT2dxf
8 Oct 24 i    `- Re: Reverse SCAN SPLIT1Ahmed
7 Oct 24 +* Re: Reverse SCAN SPLIT2Ruvim
7 Oct 24 i`- Re: Reverse SCAN SPLIT1dxf
7 Oct 24 +- Re: Reverse SCAN SPLIT1dxf
10 Oct 24 +- Re: Reverse SCAN SPLIT1dxf
10 Oct 24 `* Re: Reverse SCAN SPLIT7albert
10 Oct 24  `* Re: Reverse SCAN SPLIT6dxf
17 Oct 24   +- Re: Reverse SCAN SPLIT1minforth
17 Oct 24   `* Re: Reverse SCAN SPLIT4mhx
18 Oct 24    +- Re: Reverse SCAN SPLIT1dxf
18 Oct 24    `* Re: Reverse SCAN SPLIT2dxf
19 Oct 24     `- Re: Reverse SCAN SPLIT1albert

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal