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: 103376,99e2dadd49ce1936 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Exception Handling Date: 1996/09/19 Message-ID: <1996Sep19.145824.1@eisner>#1/1 X-Deja-AN: 184000504 x-nntp-posting-host: eisner.decus.org references: <96091718200832@psavax.pwfl.com> x-nntp-posting-user: KILGALLEN x-trace: 843159509/18107 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-09-19T00:00:00+00:00 List-Id: In article <96091718200832@psavax.pwfl.com>, "Marin David Condic, 407.796.8997, M/S 731-93" writes: > Larry Kilgallen writes: >>DEC Pascal triggers exceptions when constraints are violated, and >>catching them is done in a vendor-specific manner. I would assume >>the discussion is not limited to standard-based implementations, >>because then we would not be talking about who originate the concept >>but rather whose committee was quickest to adopt research. >> > I've long admired the quality of DEC compilers ever since using > their Fortran-10 on the PDP-10. I have two questions: 1) At what > point in time did they extend "standard" Pascal with some form of > exception processing? 2) Could you show a "simple" example of how > a user might raise & handle the exception? Thanks. >From the start the VMS operating system had exceptions built into the stack frames, so DEC Pascal V1 (1979 or so ?) users could force establishment of their own handler by calling the VMS routine LIB$ESTABLISH. When DEC Pascal V2 arrived (1982 ?) it was a total rewrite and required use of a specific language extension to establish programmer-specified handlers since the same OS mechanism was also used for language-specified handlers pertaining to the chaining for uplevel addressing as I recall. The following code has not been run through a compiler, and leaves out some of the attributes required for safe programming. The compiler would surely complain, but the is probably more clear than the version the compiler would accept: PROCEDURE MY_PROCEDURE; FUNCTION MY_HANDLER ( SIGVEC : SIGVEC_TYPE; MECHVEC : MECHVEC_TYPE ) : INTEGER; BEGIN IF SIGVEC [1] = MY_EXCEPTION_VALUE THEN MY_HANDLER := SS$_CONTINUE ELSE MY_HANDLER := SS$_RESIGNAL; END; BEGIN ESTABLISH ( MY_HANDLER ); LIB$SIGNAL ( MY_EXCEPTION_VALUE ); END; Larry Kilgallen