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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b4a4dceda94869d2 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.35.68 with SMTP id f4mr11604842pbj.5.1322230834199; Fri, 25 Nov 2011 06:20:34 -0800 (PST) Path: lh20ni16707pbb.0!nntp.google.com!news2.google.com!goblin2!goblin1!goblin.stu.neva.ru!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Iterators in Ada2012 Date: Fri, 25 Nov 2011 15:20:12 +0100 Organization: Ada @ Home Message-ID: References: <66dbca36-0248-458a-aff4-1176d6ce098b@m10g2000vbc.googlegroups.com> <4eb92ae0$0$6581$9b4e6d93@newsspool3.arcor-online.net> <4eba5c38$0$6560$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: IQsgShqvlwBVRETOGaH4CQ.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.60 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news2.google.com comp.lang.ada:14651 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2011-11-25T15:20:12+01:00 List-Id: Le Wed, 09 Nov 2011 11:55:52 +0100, Georg Bauhaus = a =C3=A9crit: > Me neither; though Ada.Numerics.*Random are examples of how > to model producing elements on demand. I imagine one can do similar > things with task objects in order to emulate a Python style yield. > The result, then, is a generating mechanism that does not require > a working set in memory. I guess one could make the mechanism > more generically useful. > > task body Generator is > Current : Value_Type; > begin > loop > Current :=3D Produce_Next; > accept Next (Result : out Value_Type) do > Result :=3D Current; > end Next; > end loop; > end Generator; The good time for a question: Are coroutines planned for Ada 2020 ? -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: [Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univer= sity]