From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: Kyzivat@Kyzivat.ultranet.com (Paul Kyzivat) Subject: Re: Exceptions as objects (was Re: What is wrong with OO ?) Date: 1997/01/25 Message-ID: <5cc1jk$8lp@decius.ultra.net>#1/1 X-Deja-AN: 212051437 references: <5acjtn$5uj@news3.digex.net> <32dd9fc8.262114963@news.sprynet.com> organization: UltraNet Communications, Inc. newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-25T00:00:00+00:00 List-Id: piercarl@sabi.demon.co.uk (Piercarlo Grandi) wrote: [snip a long and interesting explanation of exception handling] I found the discussion very interesting. In a theoretical way I agree with you. However I think in a practical sense it misses the point to an extent: For code to be readable, it is useful to have the exception handling easily and clearly lexically scoped with the code that it applies to. What you suggest is really very little different than what existed in various libraries prior to the introduction of compiler supported exception handling. I remember it in Fortran - it did a nice job of adding to the confusion of all those gotos. You are right that this really has more to do with how to suport a new form of non-local control transfer than it does exceptions. But usually non-local control transfer is required for exception handling because the function otherwise has no return arguments that can be used to express what happened. And, while TRY is ugly and clumsy in some cases, it does allow the normal flow of control to be segregated from the abnormal flow of control while still making it clear how they are related. I agree with you that classes as exceptions is in a way a kludge. But they do more than pass arguments to a handler. They also server as a hierarchical classification system for exceptions. Using classes for this is a matter of economy of language concepts. (Perhaps we can call it reuse of a language concept.) Paul Kyzivat