comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Why no abstract non-tagged types?
Date: Wed, 26 Feb 2014 21:55:47 +0100
Date: 2014-02-26T21:55:47+01:00	[thread overview]
Message-ID: <42pqaaui60zo$.jmxlk3nevhsn.dlg@40tude.net> (raw)
In-Reply-To: 2e5f406d-3fd1-4f8b-a1dd-c0c2a196cc94@googlegroups.com

On Wed, 26 Feb 2014 10:52:31 -0800 (PST), Dan'l Miller wrote:

> Please give some Ada202X mock-up of precisely what by-value types and
> scalar classes would wisely enable that are inexpressible throughout
> Ada2012.

None are. See RM 6.2(5)

> This is a two-part request:  1) explicitly, the proposed feature/syntax
> and

There exist several AIs regarding extensible enumerations that could cover
abstract enumerations as well, theoretically. If you are interested you can
search for them. All were rejected, and rightfully so. In my view the
problem can be resolved only if by-value classes were supported.

> 2) implicitly, the claim that no portion of Ada2012 can be utilized to
> accomplish that feature adequately with a different syntax

Depends on the feature.

As the subject suggests, the OP wished abstract non-tagged types. That
requires the type tag not stored in the type specific object (non-tagged =
no tag). Naturally, the tag must be present in the class-wide object in
order to support dispatch to the implementations of abstract operations
(abstract type has abstract operations).

This would make it possible (as a prerequisite) to have classes of by-value
types, such as enumerations.

> (e.g.,
> counter-claim:  another branch of this thread shows that generic
> enumerations sufficiently accomplish the OP's desired abstract
> enumerations, hence obviating the need for a 2nd syntax to accomplish the
> desired effect).

Generics cannot implement abstract enumeration, per definition of abstract
type, see RM 3.9.3(1/2).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2014-02-26 20:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21  3:04 Why no abstract non-tagged types? Britt
2014-02-21  8:33 ` Dmitry A. Kazakov
2014-02-26 18:52   ` Dan'l Miller
2014-02-26 20:55     ` Dmitry A. Kazakov [this message]
2014-02-26 21:40     ` Eryndlia Mavourneen
2014-02-24 23:12 ` Shark8
replies disabled

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