Re: THROW codes and ambiguous conditions

Liste des GroupesRevenir à cl forth 
Sujet : Re: THROW codes and ambiguous conditions
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forth
Date : 01. Jun 2025, 11:47:42
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$5c501e87$383f11cb@a5c2a2bcc067e6c0>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <2025May31.180736@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
albert@spenarnc.xs4all.nl writes:
In article <2025May31.080248@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
xxxxxxxx.fs /tmp/x.fs
 -514        -525    Gforth
  -37         -37    iforth 5.1-mini
 -261        -261    lxf 1.7-172-983
 -199        -199    SwiftForth i386-Linux 3.11.0
  -69         -69    SwiftForth x64-Linux 4.0.0-RC89
 -258        -258    VFX Forth 64 5.43
>
   -2         -13     ciforth on (whatever) linux
>
   -13 MESSAGE
   : Permission denied
   OK
   -2 MESSAGE
   : No such file or directory
   OK
>
Am I the only to use the Unix error codes?
>
You seem to be the only one who remaps them by just negating them.
This remaps them right into the range of throw codes that are
preassigned by the Forth standard in table 9.1.
>

Actually, the error returns from system calls are negative
numbers. So I do approximately:
    ( open file )  DUP 0 MIN THROW \ Now the result is a file channel id.
So I was puzzled at the term remapping. Indeed the man 3 errno
reveals that positive numbers are intended.

If you look at the results above, you will find that Gforth remaps
errno into the ior -512-errno (e.g., -514 for "No such file or
directory, and -525 for "permission denied"), and INCLUDED THROWs that
ior.

I could add -512 to them. ciforth has as one of its names
"close to ISO" Forth. This discussion proves that adhering to
the exact throw cause is of dubious value.
One of my design goals was simplicity and usability at the expense of
speed and traditional expectations. This was one of the corners cut
off. The positive errors are not compliant anyway.
E.g. gforth error number 13 (not-found compliant) is split into error 10
(malformed number) and 12 (not found in the search order).

>
For Unix signals, if Gforth does not translate them to one of the
predefined throw codes or handles the signal in some other way (e.g.,
SIGWINCH just changes what FORM returns, and is otherwise
transparent), it throws -256-sig.

gforth is a politically correct implementation. That is much
appreciated. It takes a team to maintain that and study the
standard extensively. That niche has been filled, so if that
was my priority I'd join the gforth team.

ciforth has no gratituous deviations from the standard
(by my arbitration), but it violates traditional expectations.

>
- anton

Groetjes Albert
--
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.

Date Sujet#  Auteur
31 May 25 * THROW codes and ambiguous conditions37dxf
31 May 25 +* Re: THROW codes and ambiguous conditions7Anton Ertl
31 May 25 i+* Re: THROW codes and ambiguous conditions2dxf
3 Jun21:48 ii`- Re: THROW codes and ambiguous conditions1sjack
31 May 25 i`* Re: THROW codes and ambiguous conditions4Anton Ertl
1 Jun 25 i `* Re: THROW codes and ambiguous conditions3albert
1 Jun 25 i  `* Re: THROW codes and ambiguous conditions2Anton Ertl
1 Jun 25 i   `- Re: THROW codes and ambiguous conditions1albert
1 Jun 25 `* Re: THROW codes and ambiguous conditions29Hans Bezemer
2 Jun05:58  +- Re: THROW codes and ambiguous conditions1dxf
2 Jun11:44  `* Re: THROW codes and ambiguous conditions27albert
3 Jun04:23   `* Re: THROW codes and ambiguous conditions26dxf
3 Jun07:10    +* Re: THROW codes and ambiguous conditions22Anton Ertl
4 Jun15:44    i`* Re: THROW codes and ambiguous conditions21dxf
4 Jun20:25    i `* Re: THROW codes and ambiguous conditions20sean
5 Jun07:09    i  +- Re: THROW codes and ambiguous conditions1dxf
5 Jun11:17    i  `* Re: THROW codes and ambiguous conditions18albert
6 Jun01:47    i   +- Re: THROW codes and ambiguous conditions1dxf
6 Jun07:15    i   `* Re: THROW codes and ambiguous conditions16sean
6 Jun12:00    i    `* Re: THROW codes and ambiguous conditions15albert
6 Jun22:06    i     `* Re: THROW codes and ambiguous conditions14sean
7 Jun04:10    i      `* Re: THROW codes and ambiguous conditions13dxf
7 Jun05:26    i       `* Re: THROW codes and ambiguous conditions12sean
7 Jun05:42    i        +- Re: THROW codes and ambiguous conditions1dxf
7 Jun10:43    i        +* Re: THROW codes and ambiguous conditions9Anton Ertl
7 Jun15:06    i        i`* Re: THROW codes and ambiguous conditions8dxf
7 Jun20:58    i        i `* Re: THROW codes and ambiguous conditions7Paul Rubin
8 Jun02:49    i        i  +* Re: THROW codes and ambiguous conditions3Paul Rubin
8 Jun04:36    i        i  i+- Re: THROW codes and ambiguous conditions1dxf
8 Jun09:07    i        i  i`- Re: THROW codes and ambiguous conditions1Anton Ertl
8 Jun03:16    i        i  +- Re: THROW codes and ambiguous conditions1dxf
8 Jun08:56    i        i  `* Re: THROW codes and ambiguous conditions2Anton Ertl
8 Jun15:45    i        i   `- Re: THROW codes and ambiguous conditions1dxf
7 Jun15:41    i        `- Re: THROW codes and ambiguous conditions1LIT
3 Jun09:43    +- Re: THROW codes and ambiguous conditions1John
4 Jun03:03    `* Re: THROW codes and ambiguous conditions2dxf
6 Jun11:47     `- Re: THROW codes and ambiguous conditions1Hans Bezemer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal