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,ae5e339df4dff313 X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: Language Lawyer question Date: 2000/06/02 Message-ID: #1/1 X-Deja-AN: 630419103 Sender: kst@king.cts.com References: <39380CEB.2CC4682E@ftw.rsc.raytheon.com> <8h97q3$68b$1@hobbes2.crc.com> X-Trace: thoth.cts.com 959988972 3113 205.163.0.22 (2 Jun 2000 23:36:12 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: abuse@cts.com Date: 2000-06-02T00:00:00+00:00 List-Id: "David C. Hoos, Sr." writes: > Wes Groleau wrote in message > news:39380CEB.2CC4682E@ftw.rsc.raytheon.com... > > One of my coworkers just asked an interesting question: > > > > Why do we have to write > > Some_Type'Pred (Some_Value) > > when > > Some_Value'Pred > > is more natural/intuitive and > > carries just as much type info? The grammar for an attribute reference is attribute_reference ::= prefix'attribute_designator where prefix ::= name | implicit_dereference Of course, that doesn't really answer the question; the grammar could have been defined to allow an arbitrary expression as a prefix. I suppose it was defined that way for the sake of clarity, to prevent expressions from becoming overly complex. > What is 0'Pred? If it were legal, it should be the same as 0 - 1 -- which means the resolution would depend on the context. (Note that the equivalence between Foo'Pred and Foo - 1 wouldn't apply to enumeration types.) > But, how would you do the equivalent of Modular_Type'Pred (0) > with your syntax? (Modular_Type'(0))'Pred -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Welcome to the last year of the 20th century.