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: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Exceptions as objects (was Re: What is wrong with OO ?) Date: 1997/01/25 Message-ID: #1/1 X-Deja-AN: 212197705 references: <5acjtn$5uj@news3.digex.net> <32e9e445.163056932@library.airnews.net> organization: The World Public Access UNIX, Brookline, MA 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: In article <32e9e445.163056932@library.airnews.net>, Ronald E Jeffries wrote: >In a project I'm presently working on, the input routines try to >handle all the errors. Then when the application definers decided >what kind of notifications they wanted on input errors, we had to go >in and edit the input routines and change them all around to get the >job done. Had they just thrown an exception, we could have fielded >the exception where we wanted to, and filed our notifications and gone >on. But this is true in Mr. Grandi's scheme, too. Instead of raising an exception, Mr. Grandi calls a function to handle the error. And that function is *dynamically scoped*, which means that the call site can define it. Just like the call site defines the handler code in the C++ or Ada way of doing things. What you say above is the whole point of exceptions -- one piece of code detects an error, and a different piece of code decides what to do about it. And Mr. Grandi's scheme is just as good as the C++/Ada scheme, in this regard. (I'm not sure why Mr. Grandi thinks his scheme is so vastly superior, though.) - Bob