Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #133580

Re: THROW codes and ambiguous conditions

From dxf <dxforth@gmail.com>
Newsgroups comp.lang.forth
Subject Re: THROW codes and ambiguous conditions
Date 2025-06-05 00:44 +1000
Organization i2pn2 (i2pn.org)
Message-ID <daf531f19ecb07c75994e9c0b371001c79f6929a@i2pn2.org> (permalink)
References (1 earlier) <nnd$5d07338c$61b87fbd@d4d89ef8da41e19e> <nnd$110fb7e8$4dcc4e5b@7bbd872876625f12> <nnd$4a556964$65be8f1e@0fce8f78c54657e5> <d16b6924f6dae8d40a529e36e70bd03c50755741@i2pn2.org> <2025Jun3.081034@mips.complang.tuwien.ac.at>

Show all headers | View raw


On 3/06/2025 4:10 pm, Anton Ertl wrote:
> dxf <dxforth@gmail.com> writes:
> ...
>>> But how much need today and what's wrong with ABORT"?
> 
> My guess at the thinking behind the Forth-94 committee's decisions
> about that are:
> 
> 1) ABORT" Undefined word" takes more space than -13 AND THROW.  Of
>    course, if the system then has a table for translating throw codes
>    to messages, that probably eliminates the memory savings, but a
>    system that is really tight on memory can just output the error
>    code and leave it to the user to look the error up in the manual.
>
> 2) For CATCH, every ABORT" looks the same, so you cannot do something
>    for one kind of error and something else for other kinds.  Of
>    course, the question is whether one can do that with the current
>    situation (apparently not portably for inaccessible or non-existent
>    files in INCLUDED), and whether that's something that Forth
>    programmers would make use of if the situation was otherwise.

Perhaps the TC went along with Mitch.  CATCH THROW was his idea and
here's a bunch of codes to go with it.  The extent to which a tiny forth
is going to use ANS is dubious.  Having CATCH THROW just to pass compiler
errors is dubious.  Compilers errors could be handled with ABORT" and two
characters (old-time BASIC users may remember).

>    One interesting aspect is that IIRC Mitch Bradley uses
>
>    C" <error message>" throw
> 
>    or somesuch.  If you want to catch that, you have to do it as
>    follows:
> 
>    : printer-on-fire c" printer on fire" ;
> 
>    : foo ... catch dup printer-on-fire = if ... then ... ;
>    : bar ... printer-on-fire throw ... ;
> 
>    And of course, this only make sense if the system treats an
>    uncaught throw as a counted string to be printed.

Couldn't find it in Mitch's github - unless under another name.  He
appears to use C" in a conventional way.

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-05-31 11:10 +1000
  Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-05-31 06:02 +0000
    Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-05-31 20:53 +1000
      Re: THROW codes and ambiguous conditions sjack@dontemail.me (sjack) - 2025-06-03 20:48 +0000
    Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-05-31 13:53 +0200
      Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-05-31 16:07 +0000
        Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-01 12:47 +0200
          Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-01 15:15 +0000
            Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-01 19:35 +0200
  Re: THROW codes and ambiguous conditions Hans Bezemer <the.beez.speaks@gmail.com> - 2025-06-01 19:44 +0200
    Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-02 14:58 +1000
    Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-02 12:44 +0200
      Re: THROW codes and ambiguous conditions Hans Bezemer <the.beez.speaks@gmail.com> - 2025-06-02 21:20 +0200
        Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-03 13:23 +1000
          Re: THROW codes and ambiguous conditions mhx@iae.nl (mhx) - 2025-06-03 06:04 +0000
            Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-04 12:03 +1000
              Re: THROW codes and ambiguous conditions Hans Bezemer <the.beez.speaks@gmail.com> - 2025-06-06 12:47 +0200
          Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-03 06:10 +0000
            Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-05 00:44 +1000
              Re: THROW codes and ambiguous conditions sean@conman.org - 2025-06-04 19:25 +0000
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-05 16:09 +1000
                Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-05 12:17 +0200
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-06 10:47 +1000
                Re: THROW codes and ambiguous conditions sean@conman.org - 2025-06-06 06:15 +0000
                Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-06 13:00 +0200
                Re: THROW codes and ambiguous conditions sean@conman.org - 2025-06-06 21:06 +0000
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-07 13:10 +1000
                Re: THROW codes and ambiguous conditions sean@conman.org - 2025-06-07 04:26 +0000
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-07 14:42 +1000
                Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-07 09:43 +0000
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-08 00:06 +1000
                Re: THROW codes and ambiguous conditions Paul Rubin <no.email@nospam.invalid> - 2025-06-07 12:58 -0700
                Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-08 01:31 +0200
                Re: THROW codes and ambiguous conditions Paul Rubin <no.email@nospam.invalid> - 2025-06-07 18:49 -0700
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-08 13:36 +1000
                Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-08 08:07 +0000
                Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-08 13:34 +0200
                Re: THROW codes and ambiguous conditions Paul Rubin <no.email@nospam.invalid> - 2025-06-10 14:11 -0700
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-08 12:16 +1000
                Re: THROW codes and ambiguous conditions anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-08 07:56 +0000
                Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-08 13:51 +0200
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-09 00:45 +1000
                Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-09 12:49 +0200
                Re: THROW codes and ambiguous conditions dxf <dxforth@gmail.com> - 2025-06-09 21:36 +1000
                Re: THROW codes and ambiguous conditions zbigniew2011@gmail.com (LIT) - 2025-06-09 12:24 +0000
                Re: THROW codes and ambiguous conditions zbigniew2011@gmail.com (LIT) - 2025-06-07 14:41 +0000
              Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-05 12:12 +0200
          Re: THROW codes and ambiguous conditions John <john@somewhere> - 2025-06-03 03:43 -0500
        Re: THROW codes and ambiguous conditions albert@spenarnc.xs4all.nl - 2025-06-03 12:30 +0200
          Re: THROW codes and ambiguous conditions Hans Bezemer <the.beez.speaks@gmail.com> - 2025-06-03 15:10 +0200

csiph-web