Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.misty.com!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: catch and throw, was Is multi-level function return possible? Date: Thu, 27 Mar 2014 19:21:34 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 34 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-072@comp.compilers> References: <14-03-020@comp.compilers> <14-03-023@comp.compilers> <14-03-065@comp.compilers> <14-03-068@comp.compilers> <14-03-070@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1395948345 72941 2001:470:1f07:1126:0:676f:7373:6970 (27 Mar 2014 19:25:45 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Thu, 27 Mar 2014 19:25:45 +0000 (UTC) Keywords: PL/I, errors, history Posted-Date: 27 Mar 2014 15:25:45 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1194 Bakul Shah wrote: (snip > 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? As mentioned earlier, some features of PL/I were implementations of features of OS/360. OS/360 has SPIE, Specify Program Interrupt Exit, where what they call exit is what others would call an interrupt routine. If a program interrupt occurs (fixed or floating point overflow, zerodivide, illegal instruction, and such) it will call the routine at the specified address. When that routine returns, it goes back to the original program, possibly with registers or memory modified. There is, then, the corresponding ON unit such as FIXEDOVERFLOW or ZERODIVIDE. Other exception conditions such as end of file, of even end of page when the system counts lines on a page, can also have ON units. ON units stay in effect on entering different blocks, either a new procedure or a BEGIN block. On exit from a block, any ON units on from that block are unstacked. REVERT goes back to the one on entering the current block. It seems that when multitasking is used, ON units can also be inherited by subtasks. I am not sure at all what happens when you do that, but I expect that it complicates the implementation. -- glen