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 X-Google-Thread: 101deb,bae41b8b09f58ec1,start X-Google-Attributes: gid101deb,public From: rav@goanna.cs.rmit.edu.au (Robin Vowels) Subject: Re: Exception Handling Date: 1996/09/23 Message-ID: <525ku9$j61@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 184805780 expires: 1 January 1997 00:00:00 GMT references: <96091317002428@psavax.pwfl.com> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.lang.ada,comp.lang.pl1 nntp-posting-user: rav Date: 1996-09-23T00:00:00+00:00 List-Id: "Marin David Condic, 407.796.8997, M/S 731-93" writes: >Felix Kasza writes: >>I don't know -- but I do know that IBM's /360 architecture uses a >>mechanism for OS calls which looks very much like a trap. PDPs used >>similar features to handle illegal memory references. In the late 60s >>or early 70s, I saw an APL interpreter for the PDP that expressly made >>use of this although it didn't export the functionality to the >>programmer (APL has no concept of an exception). >> > Well, if we include "hardware" in the picture, you'd have to go > back to the very first invention of an interrupt. Assemblers, of > course, let you write an interrupt handler and in that sense had > "exception processing." > When did it get incorporated in computer languages? That requires > an answer to the question: "What exactly do you mean by 'exception > processing'?" "Asynchronous transfer of control when an error is > detected by the hardware or the programmer" would allow any > language which gave you the ability to write an interrupt service > routine and/or write a software triggered interrupt to qualify. > That's most of them - except since this was always hardware > dependent, it was probably not done as part of any "language > standard" (more likely a vendor supplied utility). > If we mean "programmer triggered exceptions" then we'd have to > look to all the languages which provided some kind of syntax > similar to: "ON ERROR THEN GOTO XXXX" - which would include quite > a few very antiquated languages. > If we mean "language triggered exceptions" (runtime checks > inserted by the language translator and unseen by the programmer > which may or may not include various hardware interrupts or > exceptions which transfer control to a programmer specified chunk > of code) then I *think* that Ada83 pretty much invented it. Certainly one of the earliest -- if not *the* earliest -- was PL/I, which in 1966 introduced exception handling for a wide range of machine and programmer-defined exceptions. OTOMH, they included fixed-point overflow, floating-point overflow, floating-point underflow, subscriptrange (for subscript errors), stringrange (for substring errors), division by zero, size, endpage (for handling end-of-page exceptions), endfile (for end-of-file), data conversion errors, various file exceptions, as well as the programmer-defined exceptions. There was also a facility for handling errors of a general nature (ERROR), and even one for handling the end-of-job (FINISH). For data conversion errors, built-in functions enabled access to the erroneous data fields, and corresponding pseudo variables enabled the erroneous data to be replaced with legitimate data, and the conversion re-attempted if reqquired. These facilities are still in PL/I, and -- of course -- have been enhanced over the years. > I am > reasonably fluent in Fortran, Cobol, Pascal, C, and Ada and I have > a passing knowlege of a number of more obscure languages like > Lisp, Snobol, RPG, etc., and Ada was the first language I've ever > encountered which included something in its syntax which meets > this definition.