comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: parameters in bindings
Date: 1996/03/26
Date: 1996-03-26T00:00:00+00:00	[thread overview]
Message-ID: <dewar.827897033@schonberg> (raw)
In-Reply-To: DovLGK.Cx3.0.-s@inmet.camb.inmet.com

Mitch says

"    type thing is record ... end record;
    type thing_access is access all thing;
    procedure P (param: thing_access);
    x: aliased thing;
  begin
    p(x'access);

The type thing_access is an extra junk type that has no other use
in the program.  No actual objects of type thing_access are ever
declared or used.  It is just there to allow the parameter to be
declared.  This extra type is not needed with method 1 of declaring P.

To me the declaration of thing_access is extra useless baggage."

And no doubt a C programmer would find many type declarations in an
Ada program "useless baggage", but the response would be the same,
types are important. thing_access is not an extra junk type that
is not used, it is the type of values passed to procedure P.

I still don't like the general use of anonymous access types for this,
they just don't seem right, since an access to an object should be
exactly that, an access to an object, so it makes no conceptual sense
for an access parameter to be null. A VALUE of an access type can on
the other hand perfectly well be null.
\x1adp
\x1ap





  reply	other threads:[~1996-03-26  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-22  0:00 parameters in bindings Mitch Gart
1996-03-22  0:00 ` Robert Dewar
1996-03-26  0:00   ` Mitch Gart
1996-03-26  0:00     ` Robert Dewar [this message]
1996-03-23  0:00 ` Adam Beneschan
replies disabled

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