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,ca0cb7cf9847d846 X-Google-Attributes: gid103376,public From: jvl@ocsystems.com (Joel VanLaven) Subject: Re: Membership test problem Date: 1996/10/06 Message-ID: <1996Oct6.040427.23644@ocsystems.com>#1/1 X-Deja-AN: 187870852 references: <32551CAB.4910@aisf.com> organization: OC Systems, Inc. newsgroups: comp.lang.ada Date: 1996-10-06T00:00:00+00:00 List-Id: Robert A Duff (bobduff@world.std.com) wrote: : In article <32551CAB.4910@aisf.com>, Chris Sparks wrote: : >This seems to work. If Joel wants to have a subprogram that rejects : >objects that aren't of tag1 type explicitly, then he should do the : >above. : Is *that* what Joel wants? If so, why not this: Sorry for the confusion about what I wanted, and also for my silence on the issue that I have obviously missed (newsfeed problems). I already know a number of rather easy solutions to my "problem" such as: replace X in Tag1 with Tag1'class(X) in Tag1 or use an explicit tag check ala X'tag = Tag1'tag. Thank you for the suggestions, but I fear I did not express myself properly. I was confused by the rule because it seems to interfere with the meaning of the test rather than help enforce it. The rule not to do a tag check seems to me to simply be an optimization. After all, in non-inherited, cases if the type is a specific type, then the tag check can be statically shown to work (As far as I know). I can't see how the enforcement of a semantics-changing optimization makes sense. This is a case where an error might occur and be hidden from the programmer. It caught me, I can't explain why it is the way it is, and I would either like for it to be considered as a defect in the language, or for an explanation of why I am wrong. What I want to do can be done other ways. According to the LRM, what I did has no meaning whatsoever, X in tag is statically evaluated to false. So, I think making it either illegal or giving a warning would be in order. Note that if you "try this at home" on GNAT 3.04a at least, it will incorrectly behave as I suggest :) Again, sorry for the confusion. -- -- Joel VanLaven