comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Syntax for tagged record types
Date: 1997/05/27
Date: 1997-05-27T00:00:00+00:00	[thread overview]
Message-ID: <JSA.97May27163739@alexandria> (raw)
In-Reply-To: mheaney-ya023680002505971422590001@news.ni.net


In article <mheaney-ya023680002505971422590001@news.ni.net> mheaney@ni.net (Matthew Heaney) writes:

> In article <dewar.864485829@merv>, 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





  parent reply	other threads:[~1997-05-27  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-24  0:00 Syntax for tagged record types Robert Dewar
1997-05-25  0:00 ` Matthew Heaney
1997-05-26  0:00   ` Robert A Duff
1997-05-27  0:00   ` Jon S Anthony [this message]
1997-05-27  0:00 ` Dale Stanbrough
1997-05-27  0:00 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox