comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Abusing tagged types
Date: Mon, 1 Dec 2008 22:04:57 -0600
Date: 2008-12-01T22:04:57-06:00	[thread overview]
Message-ID: <gh2c6a$rua$1@munin.nbi.dk> (raw)
In-Reply-To: f31c3700-731a-495e-b2da-7a909ef9c5db@l33g2000pri.googlegroups.com

"Adam Beneschan" <adam@irvine.com> wrote in message 
news:f31c3700-731a-495e-b2da-7a909ef9c5db@l33g2000pri.googlegroups.com...
> On Nov 28, 6:08 am, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
>> Maciej Sobczakwrote:
>>
>> > By the way - what is the rationale for allowing Obj.Operation only for
>> > tagged types and not for all types? "Ada 2005 Rationale" does not seem
>> > to explain this.
>>
>> Actually it does but I find the explanation a bit cryptic for untagged
>> types other than access types:
>>
>> "Other variations on the rules for the use of the notation were
>> considered. One was that the mechanism should apply to untagged types
>> as well but this was rejected on the grounds that it might add to
>> rather than reduce confusion in some cases. In any event, untagged
>> types do not have class wide types so they are intrinsically simpler.
>> It would have been particularly confusing to permit the notation to
>> apply to access types especially an access type A referring to a
>> tagged type T. If the access type and the tagged type both had the
>> same or similar operations Op then ambiguities or errors could easily
>> arise."
>>
>> Maybe the AI has more details.
>
> From the beginning of AI-252:  "Note: We considered generalizing this
> to allow non-tagged types to use this shorthand, but this becomes
> complex when the type is an access type, since both the access type
> itself, and its designated type must be considered. Furthermore, the
> benefit is lower since there is no issue of class-wide operations for
> non-tagged types, so all the "interesting" operations are all from a
> single package."
>
> I don't see much other discussion in the AI about this issue; perhaps
> all the discussion about it was done elsewhere before AI-252 was
> opened.

I think most of the discussion on this came at the ARG meetings. (The text 
in the AI was the one-paragraph summary of the meeting conclusions, written 
by someone [me] that had lots of other things to do.) My recollection was 
that there was a problem with dealing with the automatic dereference and 
'Access rules when the type could be an access type. It seemed that only one 
(having those rules) or the other (having access types) worked, and we 
choose the more useful semantics by limiting it to only tagged types. 
Perhaps there is more detail in the meeting minutes (or maybe it is just 
lost).

                                         Randy.





  reply	other threads:[~2008-12-02  4:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 10:01 Abusing tagged types Maciej Sobczak
2008-11-28 10:50 ` Samuel Tardieu
2008-11-28 13:28   ` Maciej Sobczak
2008-11-28 14:08     ` Ludovic Brenta
2008-12-01 19:54       ` Adam Beneschan
2008-12-02  4:04         ` Randy Brukardt [this message]
2008-11-28 14:35     ` Jean-Pierre Rosen
replies disabled

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