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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,e276c1ed16429c03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!i5g2000yqe.googlegroups.com!not-for-mail From: ramon_garcia Newsgroups: comp.lang.ada Subject: Re: Ada is getting more popular! Date: Wed, 13 Oct 2010 15:49:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8edaf552-0104-4150-bb55-5557e8e24be3@i5g2000yqe.googlegroups.com> References: <020ea727-e8e9-4d0d-8c5f-b8ad907fc3c9@u10g2000yqk.googlegroups.com> NNTP-Posting-Host: 80.224.2.83 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1287010180 18358 127.0.0.1 (13 Oct 2010 22:49:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 13 Oct 2010 22:49:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i5g2000yqe.googlegroups.com; posting-host=80.224.2.83; posting-account=MJRf0QoAAAD4D6NLVoX5XW3Tna9p9iQ7 User-Agent: G2/1.0 X-HTTP-Via: 1.1 DAVINCI4 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:15494 Date: 2010-10-13T15:49:40-07:00 List-Id: On Oct 14, 12:34=A0am, "Vinzent Hoefler" wrote: > Huh? Since when do "out" parameters imply a copy? If the size is determinated at runtime, the caller cannot know the size in advance, and cannot allocate it. In fact, GNAT has a "secondary stack" for returning variable-size objects. > I don't understand that. Either you are creating the array > dynamically, then getting an access to it should not be a problem > or the caller already knows the bounds. The array was created statically, but I do not want code in the caller to depend on that. Or a container record was created dynamically, and the size of the array is part of the discriminant. type container(n_elemen: natural) is record a: buffer(n_elemen); end record; Imagine that this type is defined in the private part of the package. A method is provided to obtain an access to the buffer, and from that access the bounds of the array can be obtained at run time. This is not posible in general.