Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!stolfi From: stolfi (Jorge Stolfi) Newsgroups: comp.lang.modula3 Subject: Re: Local exceptions Message-ID: <9105301304.AA15278@jumbo.pa.dec.com> Date: 30 May 91 13:04:19 GMT Lines: 29 In-Reply-To: Message of 29 May 91 15:18:00 GMT from stt@inmet.inmet.com <370700001@inmet> To: stt@inmet.inmet.com Cc: m3 X-Folder-Carbon: lang-des > [S. Tucker Taft:] Ada took this path to defining the meaning of > exceptions declared in a recursive procedure, namely that each > "static" occurrence defines a unique exception. My recommendation: > Avoid the problem. Stick with top-level only. It is of marginal > use to allow local exceptions, and the butchery done to the normal > model of declarations is not worth the trouble. A strong argument for allowing local exceptions is precisely that they would simplify the model of declarations. If types, procedures, constants, and variables can be declared at any level, why should exceptions be an exception? Besides, BRANDED types already follow the "static" declaration paradigm. > Furthermore, it really gets nasty with "generics" in Ada, > since each instantiation is considered a new "static" occurrence, > requiring replication of exceptions even if otherwise the code > can be shared between two generic instantiations. I suppose this will be a problem also for Modula-3 generics, although the way the latter are implemented (with explicit instantiations) makes the non-equivalence of such exceptions more obvious and understandable. Jorge Stolfi DEC Systems Research Center ---------------------------------------------------------------------- DISCLAIMER: I'm only a user...