comp.lang.ada
 help / color / mirror / Atom feed
* Pointer function parameter
@ 2000-10-16  0:00 Mary
  2000-10-17  0:00 ` Gautier
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Mary @ 2000-10-16  0:00 UTC (permalink / raw)


How can you handle address-of-operator (&) in Ada. 

ie.

float calculation(float &num2, float num1)
{
float calc1, calc2;
//some stuff
}

Thanks.

Mary




^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: Pointer function parameter
@ 2000-10-19  0:00 Mario Amado Alves
  2000-10-19  0:00 ` Marin David Condic
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Mario Amado Alves @ 2000-10-19  0:00 UTC (permalink / raw)
  To: comp.lang.ada

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






^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2000-11-03  0:00 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-16  0:00 Pointer function parameter 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
  -- strict thread matches above, loose matches on Subject: below --
2000-10-19  0:00 Mario Amado Alves
2000-10-19  0:00 ` 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-10-21  0:00 ` Robert Dewar

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