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!news4.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!news.mailgate.org!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 15:44:43 +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> <13d6dfmiauvby.1ntqh3qbr07gr$.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 1168958683 8694 137.138.37.241 (16 Jan 2007 14:44:43 GMT) X-Complaints-To: news@@cern.ch NNTP-Posting-Date: Tue, 16 Jan 2007 14:44:43 +0000 (UTC) User-Agent: Thunderbird 1.5.0.9 (X11/20061220) In-Reply-To: <13d6dfmiauvby.1ntqh3qbr07gr$.dlg@40tude.net> Xref: g2news2.google.com comp.lang.ada:8173 Date: 2007-01-16T15:44:43+01:00 List-Id: Dmitry A. Kazakov wrote: >>> procedure Foo raises Some_Error'Class; >>> >>> should be illegal. >> Why? > > Because otherwise you could raise a type from the class, of which scope is > narrower than one of the handler. Then I would expect slicing to the type that the handler sees. Which brings another point - the handler has to *see* the type it wants to handle, which means that the type in question cannot have narrower scope anyway and even if it has, the handler will not be able to misuse it. > when E : Some_Error'Class => > when E : Some_Error => > > We definitely do not want whens to become ordered. You have them ordered already, just not in a sequence, but across all enclosing scopes (handlers are searched from "inside" to "outside", so they might as well be traversed from top to down in addition). I don't see much difference. > Even less, to have > contracts which cannot be checked. You can check it. Java guys did it, so there is a prior art. :-) -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/