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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Pointer to instance of indefinite array? Date: Tue, 12 Aug 2014 21:28:14 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <892c6798-489d-400a-bb9a-7a14605c493f@googlegroups.com> <58a951df-217b-48ee-bd0b-f9953f5b622b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 13 Aug 2014 04:28:16 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="a0c81a81d1281113b3831cf0c04e791a"; logging-data="23289"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AH4Kv5/yKnA3FORXDKkwcYgsIeBb5g4o=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 In-Reply-To: <58a951df-217b-48ee-bd0b-f9953f5b622b@googlegroups.com> Cancel-Lock: sha1:dn6bu+aIWCsFrdSAKVWgTy7oyzM= Xref: news.eternal-september.org comp.lang.ada:21705 Date: 2014-08-12T21:28:14-07:00 List-Id: On 08/12/2014 08:06 PM, NiGHTS wrote: > > Hmm. You're right. It worked! Compiler must be changing it internally to a > pointer though since it would be far too inefficient to copy the entire > array. The parameter-passing mechanism used by the compiler is generally not something we need to worry about. Having to explicitly pass a pointer to obtain by-reference semantics is a mark of low-level languages. It is not a good way to do almost anything. In a mid-level language, such as Pascal, one often specifies the parameter-passing mechanism, and the compiler uses that mechanism. This is pretty much what VAR (by reference) and non-VAR (by copy) parameters are in Pascal, though they're usually described in terms of whether or not changes to the formal parameter also change the actual. In a high-level language, such as Ada, one specifies how the subprogram uses the parameter (in, in out, and out modes) and the compiler uses that and the type being passed to determine the parameter-passing mechanism. -- Jeff Carter "That was the most fun I've ever had without laughing." Annie Hall 43