Re: THROW codes and ambiguous conditions

Liste des GroupesRevenir à cl forth 
Sujet : Re: THROW codes and ambiguous conditions
De : the.beez.speaks (at) *nospam* gmail.com (Hans Bezemer)
Groupes : comp.lang.forth
Date : 06. Jun 2025, 11:47:12
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$138a0c48$6e9b207c@a05ad5d81879a3a6>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 04-06-2025 04:03, dxf wrote:
True.  OTOH multilingual apps present a bigger problem than error msgs.
I recall my telecom days when the bulk of the equipment was Siemens and
technical manuals needed to be in English.  The scale was such it would
have required a sizeable department just for that.
It may be my ignorance, but frankly, I don't see what the fuzz is all about. I build a centralized error handling routine in virtually all my programs, both C and Forth. And interfacing those with CATCH and THROW has never posed a problem. You can even define the behavior associated with a certain THROW value. Or set up handling per subsystem:
: Monitor                              ( xt -- n)
   catch dup                            \ start processing
   if throw-string s" Internal error: " >log >>message ;then drop
;                                      \ handle and log errors
: ReadCMDB                             ( --)
   ['] Startup  Monitor                 \ initialize the program
   ['] Process  Monitor                 \ process the data
   ['] Shutdown Monitor                 \ shutdown the system
;
E.g. this one is straight from my BASIC interpreter:
0= if
   begin drop ['] interpret catch dup until
then
ds.destroy .error
If an error is detected, it's value is passed to the .ERROR routine. And I assure you, it's quite easy to interface it with localization. So - what am I missing?
Now - whether I do return codes or exceptions depends on locality and fatality. If the error can be detected within the same module, I tend to like error codes. That's why I'd like to keep the main flow shallow (stages and subsystems).
Also - if there is no way to save grace, I tend to prefer exceptions. No need to wrestle through many layers carrying an error code.
Hans Bezemer

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