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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: Generators/coroutines in future Ada? Date: Tue, 11 Jul 2017 00:24:09 +0300 Organization: Aioe.org NNTP Server Message-ID: References: <87pod8dy5j.fsf@nightsong.com> NNTP-Posting-Host: UZPBofpaGWLolaA02L4QDw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.14.10 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:47349 Date: 2017-07-11T00:24:09+03:00 List-Id: Paul Rubin wrote: > Victor Porton writes: >> Are closures really needed to implement generators? > > You can do it with OOP, like with the iterator protocol in C++. > It's ugly. I know that every algorithm can be done with OOP (or even with plain procedural programming). Every algorithm can be done with procedures without functions; this does not imply that functions are not necessary. So the question is not whether an equivalent algorithm can be coded, but whether it can be done naturally and explicitly. Is it possible to add explicit generator functions to Ada? -- Victor Porton - http://portonvictor.org