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,d0490497bd8e3f95 X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Syntax for tagged record types Date: 1997/05/27 Message-ID: #1/1 X-Deja-AN: 244320271 Distribution: world References: Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-05-27T00:00:00+00:00 List-Id: In article mheaney@ni.net (Matthew Heaney) writes: > In article , dewar@merv.cs.nyu.edu (Robert Dewar) wrote: > > >You can declare that "I think X is a kludge" for any X, but such a statement > >is only helpful to discussion if you give some idea *why* you think this. > > I say this because "discriminant" should mean "tag in a disjoint union." > Records are Cartesian product, and discriminated records are disjoint > union. And that's all discriminate record should mean. So. Where did you get this idea? That is not even what Ada83 meant by the term. In Ada95 all sorts of things can have discriminants for parameterization purposes: beater records (subsuming your one idea), task types, protected types, and private types. So, why do you say "should" here? What's your rationale for saying your notion is the "way it _should_ be"???? > Respecting the spirit of the language means not using a discriminant as a > constructor parameter. IMO, this is just plain wrong. > Norm stated in his book that "In Ada, the role of > these [constructor] parameters can be played by discriminants." (p. 579) > Now, I like Norm, and I thank him a thousand times over every time I can > pick up his book and answer a question, but this is horrible advice. When > you use a discriminant as a constructor parameter, the purpose of the > discriminant is now ambiguous. There is nothing whatsoever ambiguous about this. A discriminant is a declaration parameter. _How_ it is used in the _implementation_ of that declaration is NOT RELEVANT to the client. > And I the poor maintanence programmer have to figure out what you > mean. So I have to guess, and I might guess wrong. Unless you are dealing with the implementation of the type, why are you even thinking about how it is used??? You might as well be concerned about the exact implementation details of an abstract hash table used in the client program. /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com