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,df03e50c9b0ea255 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-26 19:33:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!csulb.edu!newshub.sdsu.edu!west.cox.net!cox.net!p02!news2.central.cox.net.POSTED!53ab2750!not-for-mail Message-ID: <3D1A7916.5010903@telepath.com> From: Ted Dennison User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: On functions and access types. References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 27 Jun 2002 02:33:12 GMT NNTP-Posting-Host: 68.12.51.201 X-Complaints-To: abuse@cox.net X-Trace: news2.central.cox.net 1025145192 68.12.51.201 (Wed, 26 Jun 2002 22:33:12 EDT) NNTP-Posting-Date: Wed, 26 Jun 2002 22:33:12 EDT Organization: Cox Communications Xref: archiver1.google.com comp.lang.ada:26732 Date: 2002-06-27T02:33:12+00:00 List-Id: Robert A Duff wrote: > Caffeine Junky writes: > > >>Now the compiler tells me that I cannot assign to an 'in' parameter. >>However, as I understand it, a function can only take an 'in' parameter. > > That's right. If you want a function to modify its argument, > you can use an access parameter, like "S: access Stack;", > and call it with Some_Stack'Access. ..or use a pointer. C also allows only "in" parameters to functions, and passing pointers is the standard work-around there. (C++ allows reference parameters though). > But in this case, it's better to use a procedure. It almost always is.