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,df854b5838c3e14 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Gripe about Ada, rep specs that won't. Date: 1996/03/21 Message-ID: #1/1 X-Deja-AN: 143607662 references: <00001a73+00002504@msn.com> <3146E324.5C1E@lfwc.lockheed.com> <4i98gg$8n1@solutions.solon.com> <4ia41k$e04@solutions.solon.com> <4ik5ip$cl6@watnews1.watson.ibm.com> <4iq71v$cvr@news4.digex.net> <4isol4$dm7@ra.nrl.navy.mil> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-03-21T00:00:00+00:00 List-Id: "Well, that's quite a nice bit of high-road preaching from behind your dais up there :-), but Ada does NOT protect you from those holes. Regardless of the value of the discriminant, you can still access ANY of the fields in a variant record. In fact, if I could rely on something like Constraint_Error in those cases, I'd probably begrudgingly accept the variant records of Ada. As it stands now, though, it just gets in my way without providing any protection: I cannot set the discriminant, and yet I can access another discriminant's fields." Of course you should get a constraint error if you access a field n the variant that does not correspond to the current discriminant value. If you find a case where this is not so, it is a bug, a significant one! Report it as such. The whole point of the discriminant check is to ensure this.