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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9ab1bf4be2d855dd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-14 06:02:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!fr.clara.net!heighliner.fr.clara.net!opentransit.net!jussieu.fr!enst!enst.fr!not-for-mail From: Christoph Grein Newsgroups: comp.lang.ada Subject: Re: Types, subtypes and ranges Date: Wed, 14 Mar 2001 14:50:00 +0100 (MET) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 984578231 85764 137.194.161.2 (14 Mar 2001 13:57:11 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 14 Mar 2001 13:57:11 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: Content-MD5: vGkTF05qgEg3Io7OrTtbQw== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0 Precedence: bulk X-Reply-To: Christoph Grein List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: supernews.google.com comp.lang.ada:5717 Date: 2001-03-14T14:50:00+01:00 Anders Wirzenius wrote: > the 'Image attribute is inherited all the way up as long as > you don't break the chain of subtypes: Your wording is not quite correct. Inheritance is used in a different sense only for type derivation. Here you have only subtypes, and these are no subtype-specific operations (OK, there are other subtype-specific attributes like 'Size). Thus e.g. Integer'Image, Natural'Image, Positive'Image all denote the same operation, there is no range check involved. Positive'Image (-1) is absolutely OK and will return "-1" and not raise an exception. The rationale behind this is that at some place you might not see the type, only the subtype. (To be very precise, you never see a type name, only the first named subtype.)