Re: bye with exit status

Liste des GroupesRevenir à cl forth 
Sujet : Re: bye with exit status
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forth
Date : 08. Nov 2024, 09:29:13
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Nov8.092913@mips.complang.tuwien.ac.at>
References : 1 2 3 4
User-Agent : xrn 10.11
mhx@iae.nl (mhx) writes:
Same as remarked by minforth: there is a exit-handler chain in
which the user can plug arbitrary routines.

In Gforth BYE is a deferred word, with the intention that it can be
extended with cleanup actions.

The disadvantage of this approach in connection with the non-0 exit is
that we probably also want to do the same cleanup in those cases.  The
best way to deal with that is probably the "EXIT-CODE !" approach.

Concerning the usual discussion about the name: I find that the system
is left in the error case with an uncaught THROW in script-execution
mode; in that case an exit code of 1 is returned by Gforth, so it's
not sufficient for communicating more than a binary result to the
calling script.  But I have not used non-binary exit codes for
non-Forth programs, either, and I do quite a bit of shell scripting.

In any case, while we have (BYE), I don't use it in application
programs.

- 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: https://forth-standard.org/
   EuroForth 2024: https://euro.theforth.net

Date Sujet#  Auteur
6 Nov 24 * bye with exit status19Ruvim
6 Nov 24 +- Re: bye with exit status1albert
6 Nov 24 `* Re: bye with exit status17Anthony Howe
6 Nov 24  `* Re: bye with exit status16minforth
6 Nov 24   `* Re: bye with exit status15mhx
7 Nov 24    +* Re: bye with exit status10Ruvim
7 Nov 24    i`* Re: bye with exit status9Anthony Howe
7 Nov 24    i +* Re: bye with exit status5Ruvim
8 Nov 24    i i+- Re: bye with exit status1mhx
8 Nov 24    i i`* Re: bye with exit status3Anthony Howe
8 Nov 24    i i `* Re: bye with exit status2Ruvim
8 Nov 24    i i  `- Re: bye with exit status1Anthony Howe
8 Nov 24    i +- Re: bye with exit status1Ron AARON
8 Nov 24    i `* Re: bye with exit status2albert
8 Nov 24    i  `- Re: bye with exit status1minforth
8 Nov 24    `* Re: bye with exit status4Anton Ertl
8 Nov 24     `* Re: bye with exit status3Ruvim
8 Nov 24      `* Re: bye with exit status2Anton Ertl
8 Nov 24       `- Re: bye with exit status1Ruvim

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal