comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Virtual Components in Ada and Ruby
Date: Fri, 1 Jul 2005 12:04:37 +0200
Date: 2005-07-01T12:04:40+02:00	[thread overview]
Message-ID: <1tkdjjsnyzc93.1rt1l7fm3eopl$.dlg@40tude.net> (raw)
In-Reply-To: 9r6dnRAyibfBolnfRVn-oA@megapath.net

On Thu, 30 Jun 2005 13:55:18 -0500, Randy Brukardt wrote:

> But the whole idea seems misguided to me - programs shouldn't be exporting
> components [including discriminants] (virtual or otherwise) in the first
> place. All of that should be hidden with a set of operations to access them,
> construct them, and the like.

So the set of operations in this case is (simplified) ".<name>" and
".<name>:=". The point is that there must be a better separation of
implementation and interface. Why something publicly declared as a tagged
record cannot be implemented using an access type?

> Ada 200Y certainly has made that easier by
> giving real constructors to limited types, so there should no longer be any
> reason to expose any components.
>
> As always, I can think of a handful of exceptions to the rule (just like
> there are a few types that probably shouldn't be tagged and derived from
> Controlled or Limited_Controlled), but there aren't enough of these to
> justify any additional language features.

It is not an additional feature in my view. It is less features, though
also a structural language reform. I'd like to remove predefined types
classes as much as possible.
 
> There's a better argument for a virtual array capability, because that has
> properties that are tough to emulate with subprograms. But even that's
> questionable (especially in face of the difficulties of defining and
> implementing slices and aggregates for such things).

Right. Slices and aggregates must become first-class citizens, first.

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



      reply	other threads:[~2005-07-01 10:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 15:17 Virtual Components in Ada and Ruby Frank J. Lhota
2005-06-30  4:12 ` Randy Brukardt
2005-06-30  7:53   ` Dmitry A. Kazakov
2005-06-30 15:53     ` Alexander E. Kopilovich
2005-06-30 18:55       ` Randy Brukardt
2005-07-01 10:04         ` Dmitry A. Kazakov [this message]
replies disabled

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