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!news4.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.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> Date: Sun, 29 Apr 2007 10:19:16 +0200 Message-ID: <1woad6hn9idy2$.6otnwphc1o0h$.dlg@40tude.net> NNTP-Posting-Date: 29 Apr 2007 10:18:58 CEST NNTP-Posting-Host: b512d10a.newsspool4.arcor-online.net X-Trace: DXC=aHRmFiLDTnW[7Non7UCi8U4IUK On Sun, 29 Apr 2007 01:06:52 +0200, Georg Bauhaus wrote: > Like Simon, I'm not sure I'm familiar with your iteration; What about iterator = an object used to describe the iteration state? (I don't see much sense in calling loops iterators. To me the iterator is rather the variable of the loop. Loop performs/implements iteration.) > my containers would be providing iteration if they can do one of > > - take a subprogram (e.g.) and call it for each of a collection > of elements > > - provide access to an element and then the next if any where the > meaning of "next" is specified in the collection's contract > > The amount of determinism need not be 100%. E.g., the post-condition > if Iterate that each element is visited once, in no particular order, > seems reasonable to me. Consider the precondition of the code performed for each element. It is "here is an unvisited element" You can easily state it for the second case, because you have the iterator's value. For the former case you have a problem, because the precondition of the subprogram cannot be formulated and hence verified in any way. That is the difference. The thing might "iterate" or not, you cannot know it, you have to unconditionally trust it. (There is also very little what you could do in the subprogram without further assumptions, like that exactly one instance of it is called at a time.) > http://www.icsi.berkeley.edu/~sather/Publications/toplas.html > > 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? (In case you would call iteration anything that can be computed as a result of some iteration, then everything computable would obviously turn to be iteration. I doubt that would be any useful definition of.) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de