comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@gmail.com>
Subject: Re: Ada 2005 Language Designer
Date: Wed, 8 Oct 2014 14:26:17 -0700 (PDT)
Date: 2014-10-08T14:26:17-07:00	[thread overview]
Message-ID: <1a27a5ce-cc98-4e87-999f-feecca3b6825@googlegroups.com> (raw)
In-Reply-To: <m1476m$ivh$1@dont-email.me>

On Wednesday, October 8, 2014 1:35:37 PM UTC-7, Jeffrey Carter wrote:
> On 10/08/2014 11:30 AM, Adam Beneschan wrote:

> > A package is not an object, neither in the sense defined by the Ada RM nor in
> > any other relevant sense.  You can't create multiple instances of it.  And
> > being able to create a variable object (or constant object, or expression
> > that produces an object) and use the dot-notation to call an operation of
> > that object is one of the things programmers came to expect of OO languages
> > that Ada 95 didn't give them; Package.Operation notation is not close to the
> > same thing.
> 
> Pkg as object was a standard technique for implementing OO designs in Ada 83, in
> which a pkg represented an object in the design. Multiple instances were
> sometimes implemented as instantiations of a parameterless generic pkg. That
> seems like a relevant sense of "object" to me.
> 
> Of course, you couldn't have components of such things, so they clearly weren't
> objects in the Ada sense.

And you couldn't pass it as a parameter to any other subprogram, nor return one from a function.  And you couldn't declare a variable of a class type, and then assign one or the other generic instantiation to that variable.  Those inabilities would make a generic instantiation of a package a very poor substitute for an OO-type object. 

But I suppose the original point, that Ada always had Object.Operation notation because you could use a package as an object, may make sense.  In fact, we could make yet another case: Ada has always had Object.Operation notation, as long as Operation was a record component name.  And then we could try to argue that a record component is a kind of operation.  That should be equally convincing.

                              -- Adam

  reply	other threads:[~2014-10-08 21:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 13:44 Ada 2005 Language Designer G.B.
2014-10-08 14:16 ` David Botton
2014-10-08 15:15   ` J-P. Rosen
2014-10-08 18:22     ` Adam Beneschan
2014-10-08 19:07       ` Dmitry A. Kazakov
2014-10-08 19:12       ` David Botton
2014-10-08 17:13   ` Jeffrey Carter
2014-10-08 17:17     ` David Botton
2014-10-08 18:30     ` Adam Beneschan
2014-10-08 20:35       ` Jeffrey Carter
2014-10-08 21:26         ` Adam Beneschan [this message]
2014-10-09 20:18           ` Shark8
2014-10-09 23:33             ` Peter Chapin
2014-10-09 20:14       ` Shark8
2014-10-09  1:07 ` brbarkstrom
replies disabled

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