Re: exception catching in PL/I

"Robin Vowels" <robin51@dodo.com.au>
Fri, 28 Mar 2014 10:50:43 +1100

          From comp.compilers

Related articles
Is multi-level function return possible? noitalmost@cox.net (noitalmost) (2014-03-10)
Re: Is multi-level function return possible? gneuner2@comcast.net (George Neuner) (2014-03-11)
Re: Is multi-level function return possible? federation2005@netzero.com (2014-03-26)
Re: catch and throw, was Is multi-level function return possible? rpw3@rpw3.org (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? usenet@bitblocks.com (Bakul Shah) (2014-03-26)
Re: exception catching in PL/I robin51@dodo.com.au (Robin Vowels) (2014-03-28)
Re: exception catching in PL/I martin@gkc.org.uk (Martin Ward) (2014-04-16)
| List of all articles for this month |

From: "Robin Vowels" <robin51@dodo.com.au>
Newsgroups: comp.compilers
Date: Fri, 28 Mar 2014 10:50:43 +1100
Organization: Compilers Central
References: 14-03-020 14-03-023 14-03-065 14-03-068 14-03-070
Keywords: PL/I, history
Posted-Date: 27 Mar 2014 20:16:57 EDT

From: "Bakul Shah" <usenet@bitblocks.com>
Sent: Thursday, March 27, 2014 5:20 PM


> PL/I had ON and SIGNAL statements. SIGNAL would signal an exception.
> ON would catch it. REVERT to cancel the effect of ON. Web search
> indicates it was defined in 1964 but implemented later. May be the
> PL/I designered borrowed it from an earlier language/facility?


PL/I provided the means to catch an exception, typically a hardware exception,
but not limited to them.
S/360 hardware exceptions included floating-point underflow, floating-point overflow,
division by zero, fixed-point overflow, and invalid decimal arithmetic.
A few of these exceptions could be turned on and off at the program level
(e.g., float underflow). Others such as an invalid decimal data interrupt could not be turned
off, and were taken by the operating system which in turn passed control to the
program's error handler.
Thus, the hardware exceptions implemented in PL/I were OVERFLOW, UNDERFLOW,
FIXEDOVERFLOW, ZERODIVIDE, and invalid decimal data.
Those implemented in software included CONVERSION, SUBSCRIPTRANGE,
STRINGRANGE, ENDPAGE, ENDFILE.
The user could introduce his own named conditions, and invoke them using a SIGNAL
statement.
ON statements established the action to be taken in the event of an exception.
SIGNAL statements were provided for testing purposes (so that you could check out
your exception-handler), and for invoking a user-defined condition.


Certain exceptions can be turned on and off at procedure level and at
statement level; hence the statement prefixes such as NOFIXEDOVERFLOW
and FIXEDOVERFLOW. Other exceptions such as ENDPAGE cannot be turned
off, but the exception handler can be a user-written null operation.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.