comp.lang.ada
 help / color / mirror / Atom feed
From: Mario Amado Alves <maa@di.fct.unl.pt>
To: comp.lang.ada@ada.eu.org
Subject: Re: Pointer function parameter
Date: 2000/10/19
Date: 2000-10-19T10:43:11+00:00	[thread overview]
Message-ID: <Pine.LNX.4.10.10010191126450.17222-100000@lexis.di.fct.unl.pt> (raw)

On Wed, 18 Oct 2000, Robert Dewar wrote:

> In article
> <Pine.LNX.4.10.10010171217210.17222-100000@lexis.di.fct.unl.pt>,
>   comp.lang.ada@ada.eu.org wrote:
> > Ada access types serve most pointer necessities. In this vein,
> the
> > Ada expression X'Access is the equivalent of the C expression
> &X (X being
> > an object).
> 
> 
> Misleading, since &x is a somewhat fundamental C diction,
> whereas X'Access is rather specialized, and has few legitimate
> uses outside certain well defined areas (including for example
> interfacing to C functions :-)

The "in this vein" is there for a reason: in the vein of using Ada access
types for the same purposes you use C pointer types for--and only in this
vein--, attribute Access is in fact the Ada equivalent of the C address
operator &.

The equivalent strito senso--not in the vein above--is of course attribute
Address. But if you use Address everywhere where you use & in the
equivalent C program, you miss a great part of the gain of using Ada
instead of C.

(Perhaps you read "Address" where it says "Access" in my first reply?)

And surely there is a _lot_ of uses of access types besides interfacing to
C: virtually all dynamic data structures (linked lists, trees, etc.)
require them.

| |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+939354005
|M|A|R|I|O|
|A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536
|A|L|V|E|S|                                                  fax 212948541
| | | | | |                 maa@di.fct.unl.pt                FCT 212948300






             reply	other threads:[~2000-10-19  0:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-19  0:00 Mario Amado Alves [this message]
2000-10-19  0:00 ` Pointer function parameter Marin David Condic
2000-10-19  0:00 ` tmoran
2000-10-19  0:00   ` Ted Dennison
2000-10-21  0:00   ` Robert Dewar
2000-10-23  0:00     ` Alejandro Villanueva
2000-10-24  0:00       ` Robert A Duff
2000-10-24  0:00         ` Alejandro Villanueva
2000-10-24  0:00           ` Ted Dennison
2000-10-24  0:00             ` Lutz Donnerhacke
2000-10-24 22:32           ` Mats Weber
2000-10-30 15:24           ` Robert A Duff
2000-10-30 15:44             ` Ken Garlington
2000-10-30 18:53               ` Florian Weimer
2000-10-31  1:48                 ` Robert Dewar
2000-10-31 12:40                   ` Ken Garlington
2000-10-31 14:08                     ` Larry Kilgallen
2000-11-01 17:59             ` Mats Weber
2000-11-03  0:00               ` Florian Weimer
2000-11-04  0:00                 ` RAM size, was " tmoran
2000-10-21  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2000-10-16  0:00 Mary
2000-10-17  0:00 ` Gautier
2000-10-17  0:00 ` tmoran
2000-10-17  0:00 ` Mario Amado Alves
2000-10-18  0:00   ` Florian Weimer
2000-10-18  0:00   ` Robert Dewar
replies disabled

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