comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Abusing tagged types
Date: Mon, 1 Dec 2008 11:54:18 -0800 (PST)
Date: 2008-12-01T11:54:18-08:00	[thread overview]
Message-ID: <f31c3700-731a-495e-b2da-7a909ef9c5db@l33g2000pri.googlegroups.com> (raw)
In-Reply-To: 256b827b-f245-43af-bf17-b663c84041ba@g38g2000yqd.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.

                                  -- Adam



  reply	other threads:[~2008-12-01 19:54 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 [this message]
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