InterviewSolution
| 1. |
What Are The Exceptions In Pl/1 |
|
Answer» PL/1 was the first mainstream language that introduced exceptions. It is interesting to note that half of extensions of C++ including exceptions was related to features that creators of C removed from PL/1 when they created the language :-). It is interesting to note that PL/1 was the first programming language that provides correct handing of such a common PROBLEM as detection of the end of the sequential file while reading. In PL/1 endfile condition is raised which activates stopped COROUTINE (exception handler) within which programmer can do WHATEVER he wish but typically jump to the statement after the loop. This usage of goto is definitely superior to misguided attempts to make this test in the header of the loop like was done in C and Perl. ON ENDFILE (SYSIN) GOTO EOF_SYSIN; It is important to note that PL/1 was used as a system programming language for such an important operating system as Multics -- the originator of many ideas that later were reimplemented in Unix. In partially bastardized way, key ideas and most of PL/1 statements and variables semantics can be found in C which should probably be considered to be an indirect derivative and great simplification of PL/1 core. PL/1 was the first mainstream language that introduced exceptions. It is interesting to note that half of extensions of C++ including exceptions was related to features that creators of C removed from PL/1 when they created the language :-). It is interesting to note that PL/1 was the first programming language that provides correct handing of such a common problem as detection of the end of the sequential file while reading. In PL/1 endfile condition is raised which activates stopped coroutine (exception handler) within which programmer can do whatever he wish but typically jump to the statement after the loop. This usage of goto is definitely superior to misguided attempts to make this test in the header of the loop like was done in C and Perl. ON ENDFILE (SYSIN) GOTO EOF_SYSIN; It is important to note that PL/1 was used as a system programming language for such an important operating system as Multics -- the originator of many ideas that later were reimplemented in Unix. In partially bastardized way, key ideas and most of PL/1 statements and variables semantics can be found in C which should probably be considered to be an indirect derivative and great simplification of PL/1 core. |
|