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,ef86287aa487b07a X-Google-Attributes: gid103376,public From: dewarr@my-dejanews.com Subject: Re: Pb with use of redefined "=" operator Date: 1998/11/06 Message-ID: <71tee6$pi5$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 408818555 References: <363F62F3.3FF7@club-internet.fr> <3640B520.D7BEEE72@elca-matrix.ch> <71sc4h$6en$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x8.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Nov 06 00:04:22 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.02 (OS/2; I) Date: 1998-11-06T00:00:00+00:00 List-Id: In article , Matthew Heaney wrote: > dewarr@my-dejanews.com writes: > > > In article , > > Matthew Heaney wrote: > > > > > It is for this reason that I always implement (the full view of) ADTs as > > > tagged, even if the partial view is not itself tagged. > > > > > > I think that this is definitely a wrong approach. The fact of the matter is > > that when you get to complex record types, it is rather rare to use the > > equality operator meaning just component equality. It seems quite unnecessary > > to introduce the overhead resulting from gratuitous tagging just in case this > > (mis)use occurs. > > So you don't like this implementation of a stack? > > type Stack_Type is private; > > private > ... > type Stack_Type is > tagged record > Items : Item_Array; > Top : Natural := 0; > end record; > > The tagging here hardly seems gratuitous, as it's necessary to correct > what is arguably a flaw in the language! Right, I think that is a poor implementation of stacks, since it results in unnecessary inefficiencies, and the utility of being able to compare stacks is marginal in typical use. There is of course the currently fashionable code-bloat style of programming where no one cares if their programs run slowly and take up too much memory, but the trouble is that if you write standard packages in this style, it very much restricts the uses they can be put to (in many embedded and safety critical applications, tagged types are eliminated for good reasons!) -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own