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,998965b11075593f X-Google-Attributes: gid103376,public From: Brian Rogoff Subject: Re: Beginner's question (array parameters to functions) Date: 1998/11/28 Message-ID: #1/1 X-Deja-AN: 416642284 References: <365F4360.F7E85C1E@columbia.edu> Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: nntp1.ba.best.com 912303324 217 bpr@206.184.139.136 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-11-28T00:00:00+00:00 List-Id: On Sat, 28 Nov 1998, Matthew Heaney wrote: > greg writes: > ... array sorting question snipped ... > > But there are two arrays no matter what: one is unsorted, and one is > sorted. Having two arrays is a condition of the problem statement, and > has nothing to do with the language. The problem statement said nothing about whether the sort modified the original array or not. Ada doesn't specify whether arrays are passed by reference; if you want to do a sort in place and return the same array then you'll use access types (pointers if you speak C) and work with references to the array. I consider it an excellent feature of Ada that there is no extra syntax for this, unlike C. -- Brian