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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3f1374bc66d2dc03 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news1.google.com!proxad.net!usenet-fr.net!news.agarik.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: creating an array Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1139897171.996297.230070@z14g2000cwz.googlegroups.com> Date: Wed, 15 Feb 2006 14:30:40 +0100 Message-ID: <14iyyw73rt5i8$.1fkeh9i1mlj3e$.dlg@40tude.net> NNTP-Posting-Date: 15 Feb 2006 14:30:40 MET NNTP-Posting-Host: 64ea0f24.newsread2.arcor-online.net X-Trace: DXC=:VTb_\:=oEgAMm2[6LHn;2LCV>7enW;^6ZC`4IXm65S@:3>? X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2905 Date: 2006-02-15T14:30:40+01:00 List-Id: On Wed, 15 Feb 2006 08:42:09 +0100, Maciej Sobczak wrote: > Dmitry A. Kazakov wrote: > >>>for Index in The_Array_Type'Range loop >>> The_Array(Index) := The_Function; >>>end loop; >> >> The_Array_Type := (others => The_Function); > ^^^^^ > Rather The_Array := ... Yes, of course. > But what's more important - could you point to a specific paragraph in > AARM that guarantees that the two above are equivalent? I mean - is it > guaranteed that (others=>The_Function) has the meaning of increasing > order of indexes? Is is possible for the implementation to call > The_Function just once and reuse its return value for all elements' > assignments? Jean-Pierre has answered this. Functions shouldn't have side effects relevant to the call context. So the result of The_Function should be independent on Index. It shouldn't read a stream, but it can call to random generator, it can create a new object, it can start a task etc. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de