comp.lang.ada
 help / color / mirror / Atom feed
From: Al Johnston <sofeise@mindspring.com>
Subject: Re: ada to c interfaces and CHARS_PTR
Date: 2000/03/15
Date: 2000-03-15T05:14:38+00:00	[thread overview]
Message-ID: <38CF1BC2.40A39D26@mindspring.com> (raw)
In-Reply-To: 8ajfsc$9a6$1@nnrp1.deja.com

> > > C has not 'in out' parameters, only 'in' parameters. To pass
> the
> >
> > ???? Although I am still trying to figure this stuff out, it
> seems to
> > me that c as as much of an in/out as any other language has.
>
> No, this is completely wrong, there is a very important semantic
> difference between passing a parameter as IN OUT (which in Ada

after spend a day trying to get from a STRING to a chars_ptr using
a chain function calls (without calling an allocator routine) I find
that
I am in no position to defined any of my understandings of anything.
It has been a bad day.

Yes, I guess there is a big deference between c's by value and ada's
mode in/out/inout modes.  I am just so used to viewing everything
in c as pass by value... if i need to pass a string in c, what really
gets passed is the "value" of the c's address (char *)... or maybe the
"value" of the address where the subroutine is to write the address
of the string (char **).

The ada code I inherited uses " foo : in system.address" as formal
parameters for all of its calls to c.  Because of this, I am not used
to thinking about ada passing/returning an array or record by
value... but instead it (ada) returns the "value" of the address
of the array or structure. This view is incredibly limited, and
I know it.  If I learned ada from supporting better code, maybe
I wouldn't have such weird understandings.

I tend to vies everything in terms of c's by value model.  I think
I better stop this habit QUICKLY.

If you wish to suggest any books in particular, I will make and effort
to get and read them.. I have spent a lot of time in cohen's book,
in the RM and Rat.

-al





  reply	other threads:[~2000-03-15  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-09  0:00 ada to c interfaces and CHARS_PTR Al Johnston
2000-03-09  0:00 ` Preben Randhol
2000-03-09  0:00   ` Al Johnston
2000-03-09  0:00 ` Gisle S�lensminde
2000-03-09  0:00   ` Al Johnston
2000-03-13  0:00     ` Robert Dewar
2000-03-15  0:00       ` Al Johnston [this message]
2000-03-11  0:00   ` Simon Wright
2000-03-14  0:00     ` Al Johnston
2000-03-15  0:00       ` Robert Dewar
2000-03-15  0:00       ` tmoran
2000-03-15  0:00         ` Al Johnston
2000-03-10  0:00 ` Al Johnston
2000-03-10  0:00 ` tmoran
2000-03-10  0:00   ` Al Johnston
replies disabled

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