• Re: Status display in QUIT ?

    From Anton Ertl@21:1/5 to dxforth on Sat Apr 9 11:57:02 2022
    dxforth <dxforth@gmail.com> writes:
    Curious to know other forthers experiences/preferences?

    The development version of Gforth diplays the stack depth after ok,
    and the stack contents in the bottom line (which is erased when
    the next line is text-interpreted).

    E.g., inputting

    s" foo" 1.23e

    results in a line

    s" foo" 1.23e ok 2 f:1

    (2 is the data stack depth, 1 the FP stack depth), and the bottom line shows:

    <2> "foo" |F:<1> 1.230000E0 |o:Forth Forth Root Forth

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: http://www.forth200x.org/forth200x.html
    EuroForth 2021: https://euro.theforth.net/2021

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From P Falth@21:1/5 to dxforth on Sat Apr 9 07:44:27 2022
    On Saturday, 9 April 2022 at 06:25:20 UTC+2, dxforth wrote:
    I recently began using a forth which did a .S (among other things) in QUIT.
    I previously considered such too verbose but have to say it's grown on me after intensive debugging involving spurious values on the stack. Some
    forths simply display DEPTH if non-zero which is akin to this teaser:

    "I've just picked up a fault in the AE35 unit. It's going to go 100% failure in 72 hours."

    No worries, Forth. I think I'll just ignore it :)

    Curious to know other forthers experiences/preferences?

    I have .OK in QUIT that prints the OK prompt and dots after it depending on the depth
    3 items on the stack will look like ok...
    the ok prompt is also printed in green. (I use a black background)

    As a complement I have : .. .S DEPTH DISCARD ;
    This will print the stack items and clear the stack. A very useful tool

    BR
    Peter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to Anton Ertl on Sat Apr 9 07:42:00 2022
    Anton Ertl schrieb am Samstag, 9. April 2022 um 14:02:28 UTC+2:
    dxforth <dxf...@gmail.com> writes:
    Curious to know other forthers experiences/preferences?
    The development version of Gforth diplays the stack depth after ok,
    and the stack contents in the bottom line (which is erased when
    the next line is text-interpreted).

    E.g., inputting

    s" foo" 1.23e

    results in a line

    s" foo" 1.23e ok 2 f:1

    (2 is the data stack depth, 1 the FP stack depth), and the bottom line shows:

    <2> "foo" |F:<1> 1.230000E0 |o:Forth Forth Root Forth


    The <2> "foo" is interesting. I guess that it appears only when the 2nd stack element
    points to a stack buffer. Otherwise it would show the numbers.

    What happens when you input "foo" at the command line?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to minf...@arcor.de on Sat Apr 9 15:42:44 2022
    "minf...@arcor.de" <minforth@arcor.de> writes:
    The <2> "foo" is interesting. I guess that it appears only when the 2nd stack element
    points to a stack buffer.

    This comes out of "...", the smart brother of ".S" <2019Apr30.180959@mips.complang.tuwien.ac.at>. It uses some heuritics
    to try to guess what the stack items mean. Often it is right,
    sometimes it is wrong. I would have to look at the code to find out
    what the exact heuristics are, but it's probably something like: the
    length part must be not too big, all bytes inside accessible, and they
    must not be control characters.

    What happens when you input "foo" at the command line?

    "foo" type \ foo ok

    The stuff behind \ is the output.

    The general principle is that ... outputs stuff in a way that you can
    also input. So we have recognizers for these things. E.g.:

    create a 10 allot
    a 1 + ... \ <1> <a+$1> ok 1
    <a+$1> = . \ -1 ok

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: http://www.forth200x.org/forth200x.html
    EuroForth 2021: https://euro.theforth.net/2021

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From S Jack@21:1/5 to P Falth on Sat Apr 9 10:23:21 2022
    On Saturday, April 9, 2022 at 9:44:28 AM UTC-5, P Falth wrote:
    This will print the stack items and clear the stack. A very useful tool

    In Fig days and before Linux it was common and convenient to hit dot twice for an illegal command
    to clear the stack. That quickly evolved to the word ".." that would clear the stack without an
    error message. But in Linux a double dot is for the parent directory. Although it has no meaning in
    my Forth I changed it to double-x, "xx", to avoid confusion.
    --
    me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to Anton Ertl on Sat Apr 9 11:37:09 2022
    Anton Ertl schrieb am Samstag, 9. April 2022 um 18:01:01 UTC+2:
    "minf...@arcor.de" <minf...@arcor.de> writes:
    The <2> "foo" is interesting. I guess that it appears only when the 2nd stack element
    points to a stack buffer.
    This comes out of "...", the smart brother of ".S" <2019Apr3...@mips.complang.tuwien.ac.at>. It uses some heuritics
    to try to guess what the stack items mean. Often it is right,
    sometimes it is wrong. I would have to look at the code to find out
    what the exact heuristics are, but it's probably something like: the
    length part must be not too big, all bytes inside accessible, and they
    must not be control characters.
    What happens when you input "foo" at the command line?
    "foo" type \ foo ok

    The stuff behind \ is the output.

    The general principle is that ... outputs stuff in a way that you can
    also input. So we have recognizers for these things. E.g.:

    create a 10 allot
    a 1 + ... \ <1> <a+$1> ok 1
    <a+$1> = . \ -1 ok

    So <a+$1> is infix while Forth is postfix ... if it helps debugging, okay.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to S Jack on Sat Apr 9 11:32:50 2022
    S Jack <sdwjack69@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I
    usually alias it to "cs" when testing stuff.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to minf...@arcor.de on Sat Apr 9 21:43:39 2022
    "minf...@arcor.de" <minforth@arcor.de> writes:
    Anton Ertl schrieb am Samstag, 9. April 2022 um 18:01:01 UTC+2:
    create a 10 allot
    a 1 + ... \ <1> <a+$1> ok 1
    <a+$1> = . \ -1 ok

    So <a+$1> is infix while Forth is postfix ... if it helps debugging, okay.

    Yes, we could also let "..." output "<a> 1 +" instead (or in this
    case, even "a 1 +" would be ok, and it would simplify the
    implementation of the body recognizer (the thing that recognizes <a>
    and would then not recognize <a+$1>).

    But OTOH <a+$1> is one space-delimited thing, which makes it easier to
    identify as one stack item; I guess that's the advantage that resulted
    in everybody from the Gforth team accept the <word+const> syntax. I
    certainly did not think about it as an infix expresson.

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: http://www.forth200x.org/forth200x.html
    EuroForth 2021: https://euro.theforth.net/2021

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Marcel Hendrix on Sun Apr 10 14:12:17 2022
    On 9/04/2022 21:06, Marcel Hendrix wrote:
    On Saturday, April 9, 2022 at 6:25:20 AM UTC+2, dxforth wrote:
    I recently began using a forth which did a .S (among other things) in QUIT. >> I previously considered such too verbose but have to say it's grown on me
    after intensive debugging involving spurious values on the stack. Some
    forths simply display DEPTH if non-zero which is akin to this teaser:

    "I've just picked up a fault in the AE35 unit. It's going to go 100% failure >> in 72 hours."

    No worries, Forth. I think I'll just ignore it :)

    Curious to know other forthers experiences/preferences?

    I think it's a question of taste.

    FORTH> : test begin 123 56 >S PI QUIT AGAIN ; ok
    FORTH> test
    [1]<1>{1}FORTH> . -s f. 123 3.141593 ok

    -marcel

    It's beneficial to automatically see the results of operations at each step - much the same way as a calculator or debugger does:

    1 2 3 ok 1 2 3 <
    + ok 1 5 <
    - ok -4 <
    . -4 ok
    pi ok 3.141593E0 <f
    2e f* ok 6.283186E0 <f

    If one makes an error then bad luck it all vanishes. IIRC 8th doesn't empty the stack on error. The latter might be acceptable in regular forth provided stack out-of-bounds continues to be monitored in the QUIT loop.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From S Jack@21:1/5 to Paul Rubin on Sun Apr 10 06:44:59 2022
    On Saturday, April 9, 2022 at 1:32:52 PM UTC-5, Paul Rubin wrote:
    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I usually alias it to "cs" when testing stuff.
    That's fine. "cs" is a little more awkward than ".." but will do. For sure ".." is for at the terminal
    operating and in test scripts. In programs I use "SP!!"; I don't do Cobol:
    I-am-clearing-the-data-stack-now
    very-good-there-were-no-errors
    --
    me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Paul Rubin on Mon Apr 11 04:42:43 2022
    On 10/04/2022 04:32, Paul Rubin wrote:
    S Jack <sdwjack69@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I usually alias it to "cs" when testing stuff.

    ABORT clears the stack without an error msg. Error msg or not I'm puzzled
    why another word is necessary. It's a rare app that needs it and trivial enough to define when one does.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to dxforth on Sun Apr 10 13:46:25 2022
    dxforth schrieb am Sonntag, 10. April 2022 um 20:42:43 UTC+2:
    On 10/04/2022 04:32, Paul Rubin wrote:
    S Jack <sdwj...@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I usually alias it to "cs" when testing stuff.
    ABORT clears the stack without an error msg. Error msg or not I'm puzzled
    why another word is necessary. It's a rare app that needs it and trivial enough to define when one does.

    "clearstack" is only a factor of ABORT.
    They are not equivalent.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to minf...@arcor.de on Mon Apr 11 14:08:19 2022
    On 11/04/2022 06:46, minf...@arcor.de wrote:
    dxforth schrieb am Sonntag, 10. April 2022 um 20:42:43 UTC+2:
    On 10/04/2022 04:32, Paul Rubin wrote:
    S Jack <sdwj...@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I
    usually alias it to "cs" when testing stuff.
    ABORT clears the stack without an error msg. Error msg or not I'm puzzled
    why another word is necessary. It's a rare app that needs it and trivial
    enough to define when one does.

    "clearstack" is only a factor of ABORT.
    They are not equivalent.

    I've been unable to make a case for factoring 'clearstack' - other than
    for systems where ABORT doesn't clear the stacks. One could point to
    forth standards and say they've not seen fit to distinguish them either.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Ertl@21:1/5 to dxforth on Mon Apr 11 06:50:33 2022
    dxforth <dxforth@gmail.com> writes:
    I've been unable to make a case for factoring 'clearstack'

    Checking this in Gforth:

    CLEARSTACK (data stack) is only called from CLEARSTACKS (data and FP
    stack) CLEARSTACKS is only called from QUIT. I have also looked at
    uses of SP! and FP! to see whether there were additional factoring opportunities, but there are not.

    So it's more a conceptual thing: When I want to clear the stacks, I
    write CLEARSTACKS. When I want to abort, I write ABORT (but I never
    want to do that; instead, I throw).

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: http://www.forth200x.org/forth200x.html
    EuroForth 2021: https://euro.theforth.net/2021

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Anton Ertl on Mon Apr 11 17:33:57 2022
    On 11/04/2022 16:50, Anton Ertl wrote:
    dxforth <dxforth@gmail.com> writes:
    I've been unable to make a case for factoring 'clearstack'

    Checking this in Gforth:

    CLEARSTACK (data stack) is only called from CLEARSTACKS (data and FP
    stack) CLEARSTACKS is only called from QUIT. I have also looked at
    uses of SP! and FP! to see whether there were additional factoring opportunities, but there are not.

    So it's more a conceptual thing: When I want to clear the stacks, I
    write CLEARSTACKS. When I want to abort, I write ABORT (but I never
    want to do that; instead, I throw).

    That begs the question of when ABORT wouldn't do. It's less typing.
    Besides there's nothing more joyous than typing 'xx' and getting a
    reaction from the system - at least I know it's still thinking :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to dxforth on Mon Apr 11 00:23:52 2022
    dxforth schrieb am Montag, 11. April 2022 um 06:08:21 UTC+2:
    On 11/04/2022 06:46, minf...@arcor.de wrote:
    dxforth schrieb am Sonntag, 10. April 2022 um 20:42:43 UTC+2:
    On 10/04/2022 04:32, Paul Rubin wrote:
    S Jack <sdwj...@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved >> >> to the word ".." that would clear the stack without an error message. >> >
    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I >> > usually alias it to "cs" when testing stuff.
    ABORT clears the stack without an error msg. Error msg or not I'm puzzled >> why another word is necessary. It's a rare app that needs it and trivial >> enough to define when one does.

    "clearstack" is only a factor of ABORT.
    They are not equivalent.
    I've been unable to make a case for factoring 'clearstack' - other than
    for systems where ABORT doesn't clear the stacks. One could point to
    forth standards and say they've not seen fit to distinguish them either.

    QUIT empties only the return stack.

    ABORT empties the data stack(s) and performs QUIT.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to dxforth@gmail.com on Mon Apr 11 12:11:36 2022
    In article <t2r1rb$ni3$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote: >I recently began using a forth which did a .S (among other things) in QUIT.
    I previously considered such too verbose but have to say it's grown on me >after intensive debugging involving spurious values on the stack. Some >forths simply display DEPTH if non-zero which is akin to this teaser:

    "I've just picked up a fault in the AE35 unit. It's going to go 100% failure
    in 72 hours."

    No worries, Forth. I think I'll just ignore it :)

    Curious to know other forthers experiences/preferences?

    ciforth (lina wina) is nice and clean and don't bother you with
    clutter besides OK.

    Unless you want to. Issue
    WANT DO-DEBUG
    and the stack is printed each time before OK.

    (Indirect Threaded Forths allow you to revector everything,
    including OK).

    Nowaday I could use a decorator:
    WANT decorated
    ' .S 'OK decorated

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marcel Hendrix@21:1/5 to dxforth on Mon Apr 11 03:11:39 2022
    On Sunday, April 10, 2022 at 6:12:21 AM UTC+2, dxforth wrote:
    On 9/04/2022 21:06, Marcel Hendrix wrote:
    On Saturday, April 9, 2022 at 6:25:20 AM UTC+2, dxforth wrote:
    [..]
    It's beneficial to automatically see the results of operations at each step - much the same way as a calculator or debugger does:

    FORTH> : ok .S ; ok
    FORTH> 1 2 3 ok
    Data: 1 2 3 ---
    System: ---
    Float: --- ok
    [3]FORTH> + ok
    Data: 1 5 ---
    System: ---
    Float: --- ok
    [2]FORTH> - ok
    Data: -4 ---
    System: ---
    Float: --- ok
    [1]FORTH> . -4 ok
    FORTH> pi ok
    Data: ---
    System: ---
    Float: 3.1415926535897932385 --- ok
    {1}FORTH> 2e f* ok
    Data: ---
    System: ---
    Float: 6.2831853071795864770 --- ok
    {1}FORTH> f. 6.283185 ok

    Like this?

    -marcel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to no.email@nospam.invalid on Mon Apr 11 12:15:47 2022
    In article <87lewe9kfh.fsf@nightsong.com>,
    Paul Rubin <no.email@nospam.invalid> wrote:
    S Jack <sdwjack69@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I >usually alias it to "cs" when testing stuff.

    cs is a little bit to terse.
    I would like to see CLS make into the standard.
    Every Forth is defining a new word with this functionality.
    I ought to be in the standard.
    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to Anton Ertl on Mon Apr 11 12:30:20 2022
    In article <2022Apr11.085033@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    dxforth <dxforth@gmail.com> writes:
    I've been unable to make a case for factoring 'clearstack'

    Checking this in Gforth:

    CLEARSTACK (data stack) is only called from CLEARSTACKS (data and FP
    stack) CLEARSTACKS is only called from QUIT. I have also looked at
    uses of SP! and FP! to see whether there were additional factoring >opportunities, but there are not.

    So it's more a conceptual thing: When I want to clear the stacks, I
    write CLEARSTACKS. When I want to abort, I write ABORT (but I never
    want to do that; instead, I throw).

    Also it is useful to revector CLS ( CLEARSTACKS ) to a NOOP.
    I don't like it that if I make a mistake the bodies are cremated
    in a blink.


    - anton


    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to dxforth@gmail.com on Mon Apr 11 12:26:28 2022
    In article <t2v8f0$1h8t$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote: >On 10/04/2022 04:32, Paul Rubin wrote:
    S Jack <sdwjack69@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I
    usually alias it to "cs" when testing stuff.

    ABORT clears the stack without an error msg. Error msg or not I'm puzzled >why another word is necessary. It's a rare app that needs it and trivial >enough to define when one does.

    You must be kidding. Teach a Forth novice to clear the stack by invoking
    a scary word like ABORT ? . Better declare ABORT obsolescent because
    it lacks clear intent, and the suggestion that it may be equivalent
    to a throw makes my head spin.
    Also ABORT doesn't work in a definition to clear the stack.

    Groetjes Albert

    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to none albert on Mon Apr 11 03:30:49 2022
    none albert schrieb am Montag, 11. April 2022 um 12:15:50 UTC+2:
    In article <87lewe9...@nightsong.com>,
    Paul Rubin <no.e...@nospam.invalid> wrote:
    S Jack <sdwj...@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved
    to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I >usually alias it to "cs" when testing stuff.
    cs is a little bit to terse.
    I would like to see CLS make into the standard.
    Every Forth is defining a new word with this functionality.
    I ought to be in the standard.

    For my taste CLS is too close to that old CLearScreen.

    I use .. quite often and like it because it is just a quick double-tap
    on the keyboard adjacent to the space bar.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Doug Hoffman@21:1/5 to dxforth on Mon Apr 11 09:22:20 2022
    On 4/10/22 12:12 AM, dxforth wrote:

    It's beneficial to automatically see the results of operations at each step - much the same way as a calculator or debugger does:

    1 2 3 ok 1 2 3 <
    + ok 1 5 <
    - ok -4 <
    . -4 ok
    pi ok 3.141593E0 <f
    2e f* ok 6.283186E0 <f

    Agreed. MacForthonVFX with judicious use of traceon and traceoff:

    -Doug


    traceon debug off
    : test begin 1 2 3 + - . pi 2e f* quit again ;
    traceoff

    debug on
    test
    begin ( 0 )
    1 ( 1 ) \ 1
    2 ( 2 ) \ 1 \ 2
    3 ( 3 ) \ 1 \ 2 \ 3
    + ( 2 ) \ 1 \ 5
    - ( 1 ) \ -4
    . -4 ( 0 )
    pi ( 0 ) ( 1 ) \ 3.141593
    2e ( 0 ) ( 2 ) \ 3.141593 \ 2.
    f* ( 0 ) ( 1 ) \ 6.283186
    quit

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Valencia@21:1/5 to minf...@arcor.de on Mon Apr 11 07:04:34 2022
    "minf...@arcor.de" <minforth@arcor.de> writes:
    For my taste CLS is too close to that old CLearScreen.
    I use .. quite often and like it because it is just a quick double-tap
    on the keyboard adjacent to the space bar.

    Me too, until I added input line editing to ForthOS.
    Now ^L (control-L) has taken over.

    Andy Valencia
    Home page: https://www.vsta.org/andy/
    To contact me: https://www.vsta.org/contact/andy.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Marcel Hendrix on Tue Apr 12 20:51:31 2022
    On 11/04/2022 20:11, Marcel Hendrix wrote:
    On Sunday, April 10, 2022 at 6:12:21 AM UTC+2, dxforth wrote:
    On 9/04/2022 21:06, Marcel Hendrix wrote:
    On Saturday, April 9, 2022 at 6:25:20 AM UTC+2, dxforth wrote:
    [..]
    It's beneficial to automatically see the results of operations at each step -
    much the same way as a calculator or debugger does:

    FORTH> : ok .S ; ok
    FORTH> 1 2 3 ok
    Data: 1 2 3 ---
    System: ---
    Float: --- ok
    [3]FORTH> + ok
    Data: 1 5 ---
    System: ---
    Float: --- ok
    [2]FORTH> - ok
    Data: -4 ---
    System: ---
    Float: --- ok
    [1]FORTH> . -4 ok
    FORTH> pi ok
    Data: ---
    System: ---
    Float: 3.1415926535897932385 --- ok
    {1}FORTH> 2e f* ok
    Data: ---
    System: ---
    Float: 6.2831853071795864770 --- ok
    {1}FORTH> f. 6.283185 ok

    Like this?

    If you've patched the system such that it automatically displays stack content, then well and good. I would suggest there's nothing to be gained displaying stacks that are empty.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to albert on Tue Apr 12 22:15:52 2022
    On 11/04/2022 20:26, albert wrote:
    In article <t2v8f0$1h8t$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote:
    On 10/04/2022 04:32, Paul Rubin wrote:
    S Jack <sdwjack69@gmail.com> writes:
    In Fig days and before Linux it was common and convenient to hit dot
    twice for an illegal command to clear the stack. That quickly evolved >>>> to the word ".." that would clear the stack without an error message.

    In gforth (and maybe it is in ANS) "clearstack" clears the stack, and I
    usually alias it to "cs" when testing stuff.

    ABORT clears the stack without an error msg. Error msg or not I'm puzzled >>why another word is necessary. It's a rare app that needs it and trivial >>enough to define when one does.

    You must be kidding. Teach a Forth novice to clear the stack by invoking
    a scary word like ABORT ? .

    Novices have never tried to type in a word that doesn't exist? They must
    be well trained :)

    Better declare ABORT obsolescent because
    it lacks clear intent, and the suggestion that it may be equivalent
    to a throw makes my head spin.

    ABORT is useful for getting back to a clean state which includes emptying
    the stacks; whereas QUIT is useful for debugging because it doesn't empty
    the stacks. In my system there's a further distinction:

    Like ABORT, QUIT may be used to terminate an application at any
    nesting level. Unlike ABORT, QUIT in DX-Forth is not considered
    an error condition and cannot be intercepted with CATCH.

    Also ABORT doesn't work in a definition to clear the stack.

    It doesn't just clear the stack if that's what you mean. Anyone that chooses 'clearstack' for the name of a function which just clears the stack, clearly never intended it to get much use. Which aligns with my experience. Novices are welcome to knock themselves out using it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From minforth@arcor.de@21:1/5 to the.bee...@gmail.com on Tue Apr 12 07:15:34 2022
    the.bee...@gmail.com schrieb am Dienstag, 12. April 2022 um 15:43:24 UTC+2:
    On Saturday, April 9, 2022 at 6:25:20 AM UTC+2, dxforth wrote:
    I recently began using a forth which did a .S (among other things) in QUIT. I previously considered such too verbose but have to say it's grown on me after intensive debugging involving spurious values on the stack. Some forths simply display DEPTH if non-zero which is akin to this teaser:

    "I've just picked up a fault in the AE35 unit. It's going to go 100% failure
    in 72 hours."

    No worries, Forth. I think I'll just ignore it :)

    Curious to know other forthers experiences/preferences?
    Well, given that 4tH has a completely different architecture:

    - When I'm testing stuff, I'm always adding either "DEPTH ." or ".S".
    The former is a "builtin", so when I remove the "TOOLS" lib, I won't get
    a compilation error;
    - When writing serious application software (like in professional enviroments)
    I'm almost always adding a check on "DEPTH" before leaving. If something is left, it can have serious repercussions - so I wanna know. For end users, it's called
    "system integrity" or "memory leak" - but that's not important right now;
    - ABORT is the "get out of here!" command. It can't be caught. If you wanna catch it, in 4tH you have to throw something. Hence, there is a THROW" as well.

    In Gforth, there is now a small indication on what's left on the stack. In its current
    form, it doesn't bother me too much. So far, it hasn't been really helpful either, but
    that might change with one single occurrence. I do mostly porting work on Gforth,
    so when something is wrong, it's usually in the differences between Gforth and
    4tH.

    When debugging 4tH, yes ".S" is my most intimate and most loyal friend. I only
    see him when I invoke him, since 4tH does not have a prompt. But I would think
    that even a friend like ".S" would become a nuisance if he dropped by uninvited.
    For that, I'd prefer the presence of "DEPTH", I think.

    A DEBUG word comes in handy now and then. Here on a stupid word:

    # : test 1 2 0 / rot ; ok
    # test
    ? test
    ^ ?? division by zero
    Stacks: r: $0 | 1 2 0 --
    Backtrace: / <- test:7
    # debug test ok
    # test
    $4482D0: deb# _[LIT] 1
    $4482E0: 1 deb# _[LIT] 2
    $4482F0: 1 2 deb# _[LIT] 0
    $448300: 1 2 0 deb# /
    ? test
    ^ ?? division by zero
    Stacks: r: $0 | 1 2 0 --
    Backtrace: / <- test:7
    #

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans Bezemer@21:1/5 to dxforth on Tue Apr 12 06:43:22 2022
    On Saturday, April 9, 2022 at 6:25:20 AM UTC+2, dxforth wrote:
    I recently began using a forth which did a .S (among other things) in QUIT.
    I previously considered such too verbose but have to say it's grown on me after intensive debugging involving spurious values on the stack. Some
    forths simply display DEPTH if non-zero which is akin to this teaser:

    "I've just picked up a fault in the AE35 unit. It's going to go 100% failure in 72 hours."

    No worries, Forth. I think I'll just ignore it :)

    Curious to know other forthers experiences/preferences?
    Well, given that 4tH has a completely different architecture:

    - When I'm testing stuff, I'm always adding either "DEPTH ." or ".S".
    The former is a "builtin", so when I remove the "TOOLS" lib, I won't get
    a compilation error;
    - When writing serious application software (like in professional enviroments) I'm almost always adding a check on "DEPTH" before leaving. If something is left, it can have serious repercussions - so I wanna know. For end users, it's called
    "system integrity" or "memory leak" - but that's not important right now;
    - ABORT is the "get out of here!" command. It can't be caught. If you wanna catch it, in 4tH you have to throw something. Hence, there is a THROW" as well.

    In Gforth, there is now a small indication on what's left on the stack. In its current
    form, it doesn't bother me too much. So far, it hasn't been really helpful either, but
    that might change with one single occurrence. I do mostly porting work on Gforth,
    so when something is wrong, it's usually in the differences between Gforth and 4tH.

    When debugging 4tH, yes ".S" is my most intimate and most loyal friend. I only see him when I invoke him, since 4tH does not have a prompt. But I would think that even a friend like ".S" would become a nuisance if he dropped by uninvited.
    For that, I'd prefer the presence of "DEPTH", I think.

    Hans Bezemer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dxforth@21:1/5 to Hans Bezemer on Wed Apr 13 11:03:53 2022
    On 12/04/2022 23:43, Hans Bezemer wrote:

    When debugging 4tH, yes ".S" is my most intimate and most loyal friend. I only
    see him when I invoke him, since 4tH does not have a prompt. But I would think
    that even a friend like ".S" would become a nuisance if he dropped by uninvited.
    For that, I'd prefer the presence of "DEPTH", I think.

    I think Marcel's .S would quickly become a nuisance :) 'depth' is no real replacement for .S Instead of a 'depth' that's a cut-down .S just cut-down
    on what .S shows. What this discussion has got me to consider is perhaps
    I need to cut-down on some of the verbosity my aborts currently display e.g.
    do I need to display "Error:" when it so blatantly is. We can all do with
    less clutter :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)