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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2e2f8b6578a7759 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-22 10:19:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3E57BF30.2090703@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: some simple questions References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 22 Feb 2003 18:18:15 GMT NNTP-Posting-Host: 63.184.9.6 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1045937895 63.184.9.6 (Sat, 22 Feb 2003 10:18:15 PST) NNTP-Posting-Date: Sat, 22 Feb 2003 10:18:15 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:34432 Date: 2003-02-22T18:18:15+00:00 List-Id: Steve wrote: > > If you add: > procedure free is new ada.unchecked_deallocation( integer, pint ); > Then free(pi) works. It seems more important to ask why the OP is using an access type. Pointers are needed far less often in Ada than in other languages; since the OP indicates that he knows [at least] one of these other languages, it is likely that this is a mind-set problem rather than a syntax question. >>and last one >>what's "std::system("clear");" translated to Ada >>(OS Linux) > > I can only guess on this one (you'll probably get an answer from someone > else). > Here's my guess: > If the profile for system looks something like: > int system( char *str ); > > Then in Ada you can use that function by declaring: > > function System( str : Interfaces.C.Strings.Char_Array_Access ) return > integer; > pragma Import( C, System, "system" ); There's no need to use Char_Array_Access here; you can simply use Char_Array and the compiler will pass it correctly. You might want to avoid the name System, since it's the name of a standard package. I have seen "system" imported and used successfully on Linux and Windows. You might also want to look for a compiler dependent package for access to the OS to do this. For example, GNAT provides the package GNAT.OS_Lib. -- Jeff Carter "Sons of a silly person." Monty Python & the Holy Grail