Sujet : Re: THROW codes and ambiguous conditions
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 31. May 2025, 17:07:36
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025May31.180736@mips.complang.tuwien.ac.at>
References : 1 2 3
User-Agent : xrn 10.11
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.
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.
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.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/EuroForth 2024 proceedings:
http://www.euroforth.org/ef24/papers/