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: Robert A Duff Subject: Re: use of attribute Pos Date: 2000/10/12 Message-ID: #1/1 X-Deja-AN: 680635054 Sender: bobduff@world.std.com (Robert A Duff) References: <39E4A08D.B454CB1C@laas.fr> <39E583F7.A971C8DB@laas.fr> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-10-12T00:00:00+00:00 List-Id: Philippe Torres writes: > type Upper is new Character range 'A'..'Z' ; > Since a different type is introduced, how does Pos still refer to > Character ? Because the *type* contains all those 256 characters. The above is essentially equivalent to: type Mumble is new Character; subtype Upper is Mumble range 'A'..'Z'; So, for example, you could say: X: Upper'Base := '+'; -- Upper'Base is the base (unconstrained) subtype. Y: Upper := Upper'Succ('@'); -- Initializes Y to 'A'. In other words, '+' and '@' are values of the type, even though Upper is constrained not to include them. - Bob