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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,685d80ec307a0c X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: use of attribute Pos Date: 2000/10/12 Message-ID: <5DiF5.1987$tN5.213230@nnrp2.sbc.net>#1/1 X-Deja-AN: 680556354 References: <39E4A08D.B454CB1C@laas.fr> <39E583F7.A971C8DB@laas.fr> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-Complaints-To: abuse@swbell.net X-Trace: nnrp2.sbc.net 971355713 208.191.184.67 (Thu, 12 Oct 2000 08:01:53 CDT) Organization: SBC Internet Services X-MSMail-Priority: Normal NNTP-Posting-Date: Thu, 12 Oct 2000 08:01:53 CDT Newsgroups: comp.lang.ada Date: 2000-10-12T00:00:00+00:00 List-Id: "Philippe Torres" wrote in message news:39E583F7.A971C8DB@laas.fr... > OK. Thank you all for your answers. > I understand the behaviour on a subtype of "constraint" attributes are > the sole to change compared to the base class. > But now, i wonder why Alejandro's solution > ---- > type Upper is new Character range 'A'..'Z' ; > begin > Put(Upper'Pos('A')) ; > --- > still manages to output 65 and not 0. > > Since a different type is introduced, how does Pos still refer to > Character ? > Should not 'new' have broken all "links" between the types Character and > Upper ? Now things get a little bit more involved. :-) The terminology invariably confuses people, so I won't be precise in that regard. Let's just say that what you really have here is a subtype of a type derived from Character. Since it has a distinct name (Upper) it is a distinct type, but it is still a constraint on Character. Hope that helps, as opposed to making it worse! :-) --- Patrick Rogers Consulting and Training in: http://www.classwide.com Deadline Schedulability Analysis progers@classwide.com Software Fault Tolerance (281)648-3165 Real-Time/OO Languages Adam ... does not deserve all the credit; much is due to Eve, the first woman, and Satan, the first consultant. Mark Twain