comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: abstract types and subprograms
Date: Sat, 24 May 2014 21:41:55 +0200
Date: 2014-05-24T21:41:55+02:00	[thread overview]
Message-ID: <1h2v68tijgc2g$.n50w7mgyza1g$.dlg@40tude.net> (raw)
In-Reply-To: wcck39bdnak.fsf@shell01.TheWorld.com

On Sat, 24 May 2014 14:49:55 -0400, Robert A Duff wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> I disagree. There is no need for instances of abstract objects, as there is
>> no need of extension aggregates. There should be proper constructors
>> instead.
> 
> You've said that many times, but I've never seen a detailed description
> of what you mean.  (Sorry if I missed it -- I don't read newsgroups
> regularly.)  Can you please show us your language design for "proper
> constructors"?

I did several times. But it can be summarized in a single sentence.

For *any* type there should be a way to define user procedure(s) [with some
parameters or without] called when the object has been created before, it
becomes available to any clients.

If an abstract parent type requires initialization the developer of the
type defines a corresponding procedure. The derived type is responsible to
provide parameters for the procedure, if any, upon its initialization.

> It seems like something like extension aggregates are needed -- you
> need a way to create an object of a type, given the value of
> an ancestor, and the values of the extension components.

No, they fail the purpose of objects creation even with that awful hack of
limited returns. It simply does not work as was demonstrated multiple
times. And that little what is supposed to work, still does not. The
semantics seems so complicated that even the latest GNAT 4.9 has bugs
there, many years since introduction of the kludge.

Aggregates should never have been misused for the purpose.

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

  reply	other threads:[~2014-05-24 19:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 10:22 abstract types and subprograms Victor Porton
2014-05-20 10:51 ` mockturtle
2014-05-20 11:45   ` Victor Porton
2014-05-20 16:27     ` Robert A Duff
2014-05-20 19:52       ` Dmitry A. Kazakov
2014-05-24 18:49         ` Robert A Duff
2014-05-24 19:41           ` Dmitry A. Kazakov [this message]
2014-05-20 11:55 ` Dmitry A. Kazakov
2014-05-20 12:28   ` Victor Porton
2014-05-20 14:11     ` Dmitry A. Kazakov
replies disabled

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