From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,699cc914522aa7c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 15 Jan 2007 15:55:20 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1168885771.30643.20.camel@localhost> <1168891576.30643.39.camel@localhost> Subject: Re: Structured exception information Date: Mon, 15 Jan 2007 15:56:14 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: <5NKdnTv2UZfVZTbYnZ2dnUVZ_vipnZ2d@megapath.net> NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-WYHt/WmgS+OrKnR035Mj/bh+IKFTVXTNEbtrGlLl764iA5Sb4UDHv/gcg0nYzhlrD2vsIZpBslUOuMU!j/IHUhEAuGjnluXGfeHFoxug4yaXiqbCddfimoaLEA4tt3tnoyMR/nS5y7XvxUHcBuPnXj1YVbg1!4anjZ5E0WQQ10A== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:8143 Date: 2007-01-15T15:56:14-06:00 List-Id: "Georg Bauhaus" wrote in message news:1168891576.30643.39.camel@localhost... > On Mon, 2007-01-15 at 20:44 +0100, Dmitry A. Kazakov wrote: > > On Mon, 15 Jan 2007 19:29:31 +0100, Georg Bauhaus wrote: > > (I don't know compilers so this is just a guess...) > > > > > > package Handling is > > > > > > -- > > > -- info to be attached to an exception occurence > > > -- > > > > > > type State is tagged record > > > info: Integer; > > > end record; > > > > > > end Handling; > > > > > > > > > with Handling; use Handling; > > > procedure foo is > > > > > > x: Integer; > > > > > > function Env return State'class is > > > begin > > > return State'(info => x); > > > end Env; > > > > > > begin > > > if 1 > 1 then > > > raise Constraint_Error with Env'access; > > > end if; > > > end foo; > > > > Ada 2005 will allow non-library-level extensions. So? What if Env were > > declared within Foo? > > (I assume you mean some type that extends State within foo.) > Yes, perhaps > (a) the nesting level of the handler, together with > (b) which ancestor is visible there, > would have to "influence" access to the components of an > extension of State. (Another wild guess.) Yuck. One of the invariants of Ada is that an object of a type can never outlive its type. Probably the way to handle this would be the same as streaming is handled. After all, the state is should be an extension of some predefined type (so that resolution will work properly). The effect would be that: raise Constraint_Error with Env'access; would raise Program_Error for a failed accessibility check. We did look at this issue when working on the Amendment. The "obvious" answers seem to have issues with visibility and compatibility with existing Ada.Exceptions mechanisms. We sent the proposal back to the author, and never got an improved proposal. Thus, it got dropped (no reflection on importance; can't do anything without a proposal). In hindsight, it probably should have been assigned to someone else, but it wasn't. Randy.