comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Exception types?
Date: 1998/06/09
Date: 1998-06-09T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.3.96.980609091815.20778A-100000@shell5.ba.best.com> (raw)
In-Reply-To: m3hg1vd4lw.fsf@mheaney.ni.net


On 8 Jun 1998, Matthew Heaney wrote:
> Brian Rogoff <bpr@shell5.ba.best.com> writes:
> 
> > One of the things that always bothered me about exceptions in Ada 
> > is that they are not really integrated into the type system, for example, 
> > they are not part of a generic signature package. I looked through the 
> > Ada 95 and Ada 83 Rationales to try to find a discussion of this topic, 
> > but I couldn't find one. Is there some record available? 
> 
> Mats Weber pointed this out too, in his PhD thesis.

Yes, I read that, and Magnus Kempe's paper on generic signature packages. 
It is also noticeable to anyone who uses any of the various ML module 
systems, which are similar to Ada except that exceptions are part of a 
module signature.

> You can work around this feature by importing a package that contains an
> exception declaration.  This is how Text_IO works, by importing package
> IO_Exceptions.
>
> ... workaround snipped ...

It isn't really a workaround, as you haven't really parameterized the
package by an exception, and you can't pass that package as a generic 
formal package parameter. Mats workaround involved passing a success/failure 
function (an exception "wrapper"), which is a little better in the
particular case I'm interested in. There are a few workarounds which
involve "programmer discipline" but I was wondering what the thinking was
behind not having typed exceptions to begin with in Ada 83. I imagine the 
reason for not having them in Ada 95 could be upward compatibility. 

I suppose this "feature" of the language will discourage the use of
exceptions in control flow, which will greatly please the Eiffel 
fanat^H^H^H^H^H advocates among us.

-- Brian





  reply	other threads:[~1998-06-09  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-08  0:00 Exception types? Brian Rogoff
1998-06-08  0:00 ` Matthew Heaney
1998-06-09  0:00   ` Brian Rogoff [this message]
1998-06-15  0:00     ` Mats Weber
1998-06-15  0:00       ` Corey Ashford
1998-06-15  0:00       ` Brian Rogoff
1998-06-21  0:00         ` Robert Dewar
1998-06-21  0:00         ` Robert Dewar
     [not found]     ` <3586FFC0.5FEC1CBC@fiu.edu>
1998-06-17  0:00       ` Jean-Pierre Rosen
1998-06-18  0:00         ` Matthew Heaney
1998-06-19  0:00           ` Jean-Pierre Rosen
1998-06-10  0:00 ` Michel Gauthier
1998-06-11  0:00   ` Brian Rogoff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox