Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mailrus!ames!vsi1!octopus!sjsumcs!horstman From: horstman@sjsumcs.sjsu.edu (Cay Horstmann) Newsgroups: comp.lang.c++ Subject: Re: Exception Handling in C++ Message-ID: <1990Apr14.053954.4815@sjsumcs.sjsu.edu> Date: 14 Apr 90 05:39:54 GMT References: <680@mead.UUCP> <1990Apr13.034540.10997@brutus.cs.uiuc.edu> Reply-To: horstman@sjsumcs.SJSU.EDU (Cay Horstmann) Distribution: usa Organization: San Jose State University Lines: 30 In article <1990Apr13.034540.10997@brutus.cs.uiuc.edu> zweig@cs.uiuc.edu writes: > >Bjarne gave a talk about the revised/ANSIfied version of this at the >USENIX C++ Conference in San Francisco the day before yesterday. >The basic idea is to introduce blocks with exception-handlers like: > >try { > //some code which might say "throw Foo();" or "throw Bar();" >} >catch(Foo f) { > //f is an object of type Foo which is the exception -- it's > //constructor could take arguments so the exception can tell you stuff >} ... >So wait until your local library gets a copy of the proceedings and all >will be revealed. > Actually, the paper uses the SAME keyword for throwing and catching: catch( f() ) throws--see the difference between it and catch( Foo f )? I am all for keyword saving, but this one is too much. (Well, we should be grateful he didn't use "virtual" or "static"--the all-purpose keywords of the 90s.) In his talk he did use "throw" and "catch". What is wrong with "raise" and "handle" ? Not catchy enough? Cay P.S. The keyword "try" is not really necessary. One could take the position (like some languages do) that each block can have its own "handle" clause handling any errors encountered in that block.