From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef6c792702c0ff46 X-Google-Attributes: gid103376,public From: Al Johnston Subject: Re: ada to c interfaces and CHARS_PTR Date: 2000/03/15 Message-ID: <38CF1BC2.40A39D26@mindspring.com>#1/1 X-Deja-AN: 597665270 Content-Transfer-Encoding: 7bit References: <38C7E515.29C42580@mindspring.com> <38C81310.41EB934A@mindspring.com> <8ajfsc$9a6$1@nnrp1.deja.com> X-Accept-Language: en X-Server-Date: 15 Mar 2000 05:14:38 GMT Content-Type: text/plain; charset=us-ascii Organization: MindSpring Enterprises Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-03-15T05:14:38+00:00 List-Id: > > > 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