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 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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: Generators/coroutines in future Ada? Date: Wed, 12 Jul 2017 10:09:26 -0700 Organization: A noiseless patient Spider Message-ID: <87o9sp4m61.fsf@nightsong.com> References: <87pod8dy5j.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="c3553a461fe13066e5e573bd233b3eaf"; logging-data="2647"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0Ua8refJn8OhJFjfZpjVe" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:vaCCKlBfuCJuedYlTmrCxTc+fRw= sha1:gOfBLEP+8LOSHPUHDxbBkz2IjDw= Xref: news.eternal-september.org comp.lang.ada:47384 Date: 2017-07-12T10:09:26-07:00 List-Id: Victor Porton writes: > every algorithm can be done with OOP... > So the question is not whether an equivalent algorithm can be coded, but > whether it can be done naturally and explicitly. There is a fairly natural bijection between OOP and closures, if that's what you're asking. > Is it possible to add explicit generator functions to Ada? I don't know if Ada has syntactic support for traversing a container by calling some method on it. C++ and Python both have that and I doubt it would be a big deal to add it to Ada if it's not there already.