comp.lang.ada
 help / color / mirror / Atom feed
From: James Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Ada 0x: Re: Representation clause
Date: Sat, 24 Feb 2001 17:47:07 GMT
Date: 2001-02-24T17:47:07+00:00	[thread overview]
Message-ID: <3A97F419.6E2F075@worldnet.att.net> (raw)
In-Reply-To: 87wvagweck.fsf@deneb.enyo.de

My assertion that Program_Error will be raised is based upon the result
of tests using GNAT 3.13p. Note that my code does NOT rely on that or
any other exception being raised to run properly. It detects the
erroneous condition without causing any exception to be raised.

It does raise its own exception when an erroneous condition is
detected. 

I admit that I may have generalized the response too much based upon
testing with one compiler. On the other hand, my solution does not
rely on that generalization. I therefore feel that my solution is only
half bad :-).

Jim Rogers
Colorado Springs, Colorado 

Florian Weimer wrote:
> 
> James Rogers <jimmaureenrogers@worldnet.att.net> writes:
> 
> > If the following is attempted, Program_Error will be raised at run-time.
> >
> >    function Convert is new Ada.Unchecked_Conversion(Source => Integer,
> >                     Target => Colors);
> >
> >    Enum_Value : Colors := Convert(2);
> 
> Eh, could you provide a RM reference which supports your claim?  I
> don't think you can rely on a Program_Error exception in such cases.
> Constraint_Error might be raised as well, or no exception at all.



  reply	other threads:[~2001-02-24 17:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-23  2:39 Representation clause Anatoly Chernyshev
2001-02-23  3:59 ` James Rogers
2001-02-23  8:46   ` Ada 0x: " Martin Dowie
2001-02-23  9:01     ` Lutz Donnerhacke
2001-02-23 10:22       ` David C. Hoos, Sr.
2001-02-23 13:56         ` Florian Weimer
2001-02-23 14:57           ` David C. Hoos, Sr.
2001-02-23 21:38             ` Florian Weimer
2001-02-23 21:12     ` Randy Brukardt
2001-02-24  5:44       ` James Rogers
2001-02-24 10:43         ` Florian Weimer
2001-02-24 17:47           ` James Rogers [this message]
2001-02-26 19:51             ` Randy Brukardt
2001-02-26 20:20               ` James Rogers
     [not found]                 ` <WURm6.3437$7e6.1392211@homer.alpha.net>
2001-02-28  2:32                   ` James Rogers
2001-02-23 13:25 ` Marc A. Criley
2001-02-23 14:08 ` Des Walker
2001-02-24 13:26 ` David C. Hoos, Sr.
2001-02-24 14:45   ` Ken Garlington
2001-02-25 20:22     ` David C. Hoos, Sr.
2001-02-26  0:53       ` Ken Garlington
replies disabled

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