Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ucbvax!SUN.COM!crb From: crb@SUN.COM.UUCP Newsgroups: comp.lang.modula2 Subject: Exception Handling Message-ID: <8702091647.AA22386@odysseus.sun.com> Date: Mon, 9-Feb-87 11:47:39 EST Article-I.D.: odysseus.8702091647.AA22386 Posted: Mon Feb 9 11:47:39 1987 Date-Received: Tue, 10-Feb-87 06:24:13 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 37 > Could we get a discussion going on exception handling in Modula-2? ... I agree with the opinion expressed by some others that the lack of a defined mechanism for dealing with exceptional conditions is a shortcoming. And I do not believe that such capability is in violation of the principles of gotoless programming, if designed in such a way that the potential behavior of a program is easy to understand by static inspection of the program text. I think setjmp/longjmp is truly awful -- the user's program flow becomes extremely convoluted -- and the routines themselves are quite ugly, too. One could argue that other languages (COBOL, FORTRAN, ... ) have gotten along quite well without any defined exception-handling capability, but these aren't languages in the same league, or of the same "generation" as are Modula-2 and Ada. Personally, I'd like to see this particular capability made part of the language, if it was cheap to implement and cheap at runtime. And I'd a lot rather see it made part of the standard than to have umpteen different vendors go off and invent umpteen different ways to do it. And at least umpteen will do so. In light of this, I'd like to suggest that people interested in the topic would do well to consider the proposal put forth by Martin Odersky, Peter Sollich, and Mike Weisert of Borland International, which was written up in the November '85 issue of the MODUS quarterly (page 13). I think it makes pretty good sense; it's "elegant" and it wouldn't cost too much to implement. The only disagreement I've got with it is their idea of the RAISE construct optionally allowing a character string, and then not making that string available to the handler which captures the exception. -- Chuck Bilbe Modula-2 Project Leader Sun Microsystems (* the opinions expressed here are my own and don't necessarily *) (* reflect the opinions or plans of Sun Microsystems. *)