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!news1.google.com!news3.google.com!news.glorb.com!news.ecp.fr!news.in2p3.fr!in2p3.fr!kanaga.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Structured exception information Date: Tue, 16 Jan 2007 11:45:54 +0100 Organization: CERN News Message-ID: References: <1168885771.30643.20.camel@localhost> <1168891576.30643.39.camel@localhost> <5NKdnTv2UZfVZTbYnZ2dnUVZ_vipnZ2d@megapath.net> <38z8yk9z1uxn$.1r6qpevwu2i7c.dlg@40tude.net> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: cernne03.cern.ch 1168944354 1300 137.138.37.241 (16 Jan 2007 10:45:54 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Tue, 16 Jan 2007 10:45:54 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) In-Reply-To: <38z8yk9z1uxn$.1r6qpevwu2i7c.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:8161 Date: 2007-01-16T11:45:54+01:00 List-Id: Dmitry A. Kazakov wrote: > I think that a more "obvious" answer to me would be a contracted model of > exceptions a-la Java. Then we would have in Georg's case (the syntax is > imaginary): > > procedure Foo raises Foo_Error; -- Compile error! > > procedure Foo is > type Foo_Error is exception with ...; > begin > ... > raise Foo_Error'(...); > ... or maybe: raise Foo_Error with (A => X; B => Y; C => Z); as a natural extension for raise with message. > One problem with above is that > > procedure Foo raises Some_Error'Class; > > should be illegal. Why? You would need to allow it at least in those subprograms that accept class-wide parameters, otherwise the open-close principle of OO would not hold (it would not be possible to extend the given hierarchy without messing with *all* the subprograms that operate on existing class-wide types). -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/