comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Abusing tagged types
Date: Fri, 28 Nov 2008 06:08:41 -0800 (PST)
Date: 2008-11-28T06:08:41-08:00	[thread overview]
Message-ID: <256b827b-f245-43af-bf17-b663c84041ba@g38g2000yqd.googlegroups.com> (raw)
In-Reply-To: 7cca32f3-0815-4564-b83a-d19a0e59b8ab@l42g2000yqe.googlegroups.com

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.

--
Ludovic Brenta.



  reply	other threads:[~2008-11-28 14:08 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 [this message]
2008-12-01 19:54       ` Adam Beneschan
2008-12-02  4:04         ` Randy Brukardt
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