Re: Parsing timestamps?

Liste des GroupesRevenir à cl forth 
Sujet : Re: Parsing timestamps?
De : zbigniew2011 (at) *nospam* gmail.com (LIT)
Groupes : comp.lang.forth
Date : 10. Jun 2025, 18:34:42
Autres entêtes
Organisation : novaBBS
Message-ID : <27d89e3b8d5941580857b9001bc0f555@www.novabbs.com>
References : 1 2 3 4 5 6 7
User-Agent : Rocksolid Light
So now you see: one can either use variable to
make the solution cleaner - or one can create new word(s).
Either way - some new names are added to the vocabulary.
Why the use of variable, instead of new words,
should be perceived of 'inferior'? Variable is a word too.
>
Unlike variables, factors (subroutines) don't contradict effective
stack-based programming.
From "Thinking Forth":
"TIP: Simplify code by using the stack. But don’t stack too
 deeply within any single definition. Redesign, or, as a last resort,
 use a named variable.
Some newcomers to Forth view the stack the way a gymnast views
a trampoline: as a fun place to bounce around on. But the stack
is meant for data-passing, not acrobatics.
[..]
(not going to paste (almost) whole chapter, but you may want
 to read the section "Redesign" that follows the above)
I’ve been guilty many times of playing hotshot, trying to do
as much as possible on the stack rather than define a local
variable. There are three reasons to avoid this cockiness.
First, it’s a pain to code that way. Second, the result
is unreadable. Third, all your work becomes useless when
a design change becomes necessary, and the order of two
arguments changes on the stack. The DUPs, OVERs and ROTs
weren’t really solving the problem, just jockeying things
into position. With this third reason in mind, I recommend
the following:
TIP: Especially in the design phase, keep on the stack only
 the arguments you’re using immediately. Create local
 variables for any others. (If necessary, eliminate the variables
 during the optimization phase.)
Fourth, if the definition is extremely time-critical, those
tricky stack manipulators, (e.g., ROT ROT) can really eat up
clock cycles. Direct access to variables is faster."
Yes, Brodie warns us next "but careful with variables' use
too" - and I still think my use of variables in two examples
I recently pasted wasn't "legit" in any way. It was just
applying the tips you see above.
--

Date Sujet#  Auteur
6 Oct 24 * Parsing timestamps?77dxf
6 Oct 24 +* Re: Parsing timestamps?40mhx
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?36B. Pym
7 Jun15:36 i +* Re: Parsing timestamps?21dxf
7 Jun18:07 i i`* Re: Parsing timestamps?20LIT
8 Jun03:38 i i `* Re: Parsing timestamps?19dxf
9 Jun14:21 i i  `* Re: Parsing timestamps?18Hans Bezemer
9 Jun14:34 i i   `* Re: Parsing timestamps?17LIT
9 Jun20:31 i i    `* Re: Parsing timestamps?16Hans Bezemer
9 Jun21:00 i i     `* Re: Parsing timestamps?15LIT
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?2LIT
10 Jun14:12 i i      i`- Re: Parsing timestamps?1Hans Bezemer
10 Jun12:08 i i      +* Re: Parsing timestamps?2LIT
10 Jun13:56 i i      i`- Re: Parsing timestamps?1LIT
10 Jun13:07 i i      +* Re: Parsing timestamps?2Stephen Pelc
10 Jun15:06 i i      i`- Re: Parsing timestamps?1Anton Ertl
10 Jun13:48 i i      +* Re: Parsing timestamps?3LIT
10 Jun21:56 i i      i`* Re: Parsing timestamps?2LIT
11 Jun10:18 i i      i `- Re: Parsing timestamps?1Hans Bezemer
10 Jun15:56 i i      `- Re: Parsing timestamps?1Hans Bezemer
9 Jun13:34 i +- Re: Parsing timestamps?1B. Pym
10 Jun10:18 i `* Re: Parsing timestamps?13B. Pym
10 Jun11:32 i  +* Re: Parsing timestamps?11dxf
10 Jun11:43 i  i`* Re: Parsing timestamps?10LIT
10 Jun15:58 i  i `* Re: Parsing timestamps?9dxf
10 Jun16:39 i  i  +- Re: Parsing timestamps?1LIT
10 Jun18:34 i  i  `* Re: Parsing timestamps?7LIT
10 Jun18:39 i  i   +- Re: Parsing timestamps?1LIT
11 Jun02:49 i  i   +* Re: Parsing timestamps?4dxf
11 Jun10:04 i  i   i+* Re: Parsing timestamps?2LIT
11 Jun11:49 i  i   ii`- Re: Parsing timestamps?1dxf
11 Jun10:58 i  i   i`- Re: Parsing timestamps?1LIT
11 Jun10:41 i  i   `- Re: Parsing timestamps?1Hans Bezemer
11 Jun10:25 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