Re: sh-boom again



John Passaniti wrote:

Your recent code (not in Forth, but in LSE/whatever) pointed to the use of variables instead of using the stack. You stated that using the stack was an example of "cleverness." So would you say that (for example) code in the Forth Scientific Library is equally guilty of this "cleverness" and instead of using anonymous stack entries for calculations should move immediately to using variables?
>
> Regardless, I'm really struggling to understand your point.

When the data flow through the code is naturally LIFO, use the stack. When it isn't, don't. Why is that difficult to understand?

--
---
John Doty, Noqsi Aerospace, Ltd.
---
His diagnosis of the hostility ... reflects the willful blindness of the invader who assures himself that the natives are only made unfriendly by some other provocation than his own. -Barbara W. Tuchman
.



Relevant Pages

  • Re: sh-boom again
    ... When coding in Forth, if I find that stack manipulation is getting too convoluted, I use that as a flag that I'm likely doing something wrong, and I either need to factor my words better, reevaluate the order of arguments on the stack, or make some other change. ... But often the programmer just substitutes one form of inefficiency for another. ... If your argument is that stack gymnastics is just "cleverness" and your customers want clearer code, why not let them enter in equations in a form familiar to them? ... Isn't infix more natural and direct for them? ...
    (comp.lang.forth)
  • Re: C-programmer needs Forth advice
    ... John Passaniti wrote: ... For instance in the above examples are the stack comments really ... > lets you have a finer-grained factoring. ... people wouldn't have attempted to write such code without locals. ...
    (comp.lang.forth)
  • Re: Starting Forth, starting out.
    ... In LSE "depth drop iterate" clears the stack! ... His diagnosis of the hostility ... ... reflects the willful blindness of the invader who assures himself that the natives are only made unfriendly by some other provocation than his own. ...
    (comp.lang.forth)
  • Re: LSE64 in standard Forth
    ... John Passaniti wrote: ... operands to the appropriate stack? ... it is *impractical* to implement LSE64 portably in Standard Forth. ... As I pointed out in my last message, all his primitive math operators, integer and float, work by first copying the top of stack to a temporary. ...
    (comp.lang.forth)
  • Re: Renaissance of Forth
    ... John Passaniti writes: ... visibility of Forth's stack and the grammar didn't appear to have any ...
    (comp.lang.forth)