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,229ea0001655d6a2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!out03b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Generic Package Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.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: <1177539306.952515.222940@s33g2000prh.googlegroups.com> <1177601484.444701.171560@r35g2000prh.googlegroups.com> <9eejm6rqip.fsf@hod.lan.m-e-leypold.de> <19qllkvm6ut42$.1iqo74vjgmsrv$.dlg@40tude.net> <1177801611.10171.32.camel@localhost.localdomain> <1woad6hn9idy2$.6otnwphc1o0h$.dlg@40tude.net> <1177929029.6111.34.camel@localhost> Date: Mon, 30 Apr 2007 14:16:29 +0200 Message-ID: NNTP-Posting-Date: 30 Apr 2007 14:16:07 CEST NNTP-Posting-Host: 36df8d3b.newsspool1.arcor-online.net X-Trace: DXC=PCd@e5ckaPkeoCI^f\Y]Eaic==]BZ:afn4Fo<]lROoRaFl8W>\BH3YbkoF<@50ADNeDNcfSJ;bb[eIRnRBaCdl:[8WgP=f2Td X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15421 Date: 2007-04-30T14:16:07+02:00 List-Id: On Mon, 30 Apr 2007 12:30:29 +0200, Georg Bauhaus wrote: > On Sun, 2007-04-29 at 10:19 +0200, Dmitry A. Kazakov wrote: > > My subprogram can hardly be arranged to be called with an element > more than once by For_Each, or not at all (instantiation not > being recursive in Ada): > "your subprogram is called with each element once" is part of the > contract of For_Each. The point is that you cannot state this contract formally. It is equivalent to the well-ordering principle, I guess. > So it is not a question of trusting the iterator but rather > a mere consequence of trust in the iterator being defined > as required by the specification of iterator. But you could not present any formal specification of. Consider the program that counts elements of a set: C : Protected_Integer; procedure Count is begin C.Inc; end Count; begin C.Set (0); foreach S do Count; How could you prove that C.Get = S'Length? >>> Is there iteration in the following SETL expression? >>> >>> Result := { x : x in {1, 3, 24, 17, 11} | P(x) }; >> >> Iteration in what? In the language construct? In Result? Consider a >> possibility that Result were computed at compile time. Would it still be >> iteration? > > That's the point, there is iteration in this set former, but it > happens behind the scene: on an AS-IF basis, it does not even matter > when (or even if) iteration is happening; Right, that is _the_ point. What is the reason to call this "iteration," rather than an operation constructing a new set? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de