comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Allocation questions
Date: Thu, 28 May 2009 12:58:11 -0500
Date: 2009-05-28T12:58:11-05:00	[thread overview]
Message-ID: <gvmjca$j2r$1@munin.nbi.dk> (raw)
In-Reply-To: 336b285f-2245-4ede-8528-841a2c713e80@b7g2000pre.googlegroups.com

>"Adam Beneschan" <adam@irvine.com> wrote in message 
>news:336b285f-2245-4ede-8528-841a2c713e80@b7g2000pre.googlegroups.com...
>On May 28, 6:39 am, Martin <martin.do...@btopenworld.com> wrote:
>> > 2 more questions:
>>
>> > 1) In fact (due to my background!), I would like to use the dot 
>> > notation:
>> > object.method.
>> > So I have add "tagged":
>
>I'm not sure I'd recommend declaring a type "tagged" JUST to get the
>dot notation.  There's a small amount of overhead involved with making
>a type tagged; but more importantly, a fair number of language rules
>are different for tagged types than for untagged types.  (You ran into
>one different rule below; another one that comes to mind immediately
>is that there are differences in the semantics of "=".  There are
>others.  You might not run into any of them, though.)

That's strange advice, given that the mantra of the Ada 95 team was that 
"tagged types work right". Yes, there are minor differences in semantics, 
but in all cases that I know of, tagged types work more logically than 
untagged types (mainly because of compatibility issues). I'd be more likely 
to reverse the advice and suggest that you declare all of your records 
tagged. (Well, I'd go further and suggest that pretty much everything ought 
to be declared controlled, which of course subsumes tagged, but that isn't 
as clear cut.)

I can understand a concern about the overhead of a tag, but that only 
matters if there are going to be many of these objects and the objects are 
relatively small (given that tags are fairly small). Neither of those seems 
to be true in this case.

                                               Randy.








  reply	other threads:[~2009-05-28 17:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28  9:46 Allocation questions Olivier Scalbert
2009-05-28 10:02 ` Martin
2009-05-28 11:55   ` xavier grave
2009-05-28 12:19     ` Ludovic Brenta
2009-05-28 13:00       ` Georg Bauhaus
2009-05-28 23:13       ` Robert A Duff
2009-05-28 10:05 ` Dmitry A. Kazakov
2009-05-28 10:40   ` Martin
2009-05-28 12:32     ` Olivier Scalbert
2009-05-28 13:39       ` Martin
2009-05-28 13:57         ` Olivier Scalbert
2009-05-28 14:51         ` Adam Beneschan
2009-05-28 17:58           ` Randy Brukardt [this message]
2009-05-28 14:04       ` Dmitry A. Kazakov
2009-05-28 16:59 ` Jeffrey R. Carter
2009-05-28 17:26   ` Olivier Scalbert
replies disabled

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