comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Generators/coroutines in future Ada?
Date: Wed, 12 Jul 2017 20:39:07 +0300
Date: 2017-07-12T20:39:07+03:00	[thread overview]
Message-ID: <ok5mrq$15lb$1@gioia.aioe.org> (raw)
In-Reply-To: 87o9sp4m61.fsf@nightsong.com

Paul Rubin wrote:

> Victor Porton <porton@narod.ru> 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.

I am asking for the easier (smaller code) side of the bijection. That 
generator functions with "yield" (in Python sense) can be replaced with 
another side of the bijection does not necessarily mean that we should use 
the more long code side of the bijection, when we have shorter and probably 
easier to understand (and thus probably more reliable) code at the another 
side of the bijection.

>> 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.

I am not about syntactic support for traversing a container by calling some 
method of it (certainly both Ada, Python, and C++) do support it.

I am about iterators coded as a function with "yield" construct (in Python 
sense). I am not about iterators coded with plain OOP without using "yield" 
or a similar construct.

-- 
Victor Porton - http://portonvictor.org


  reply	other threads:[~2017-07-12 17:39 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 20:19 Generators/coroutines in future Ada? Victor Porton
2017-07-09 21:28 ` Dennis Lee Bieber
2017-07-09 23:56   ` Victor Porton
2017-07-10  7:33   ` Dmitry A. Kazakov
2017-07-10 13:38 ` Victor Porton
2017-07-10 17:01   ` Paul Rubin
2017-07-10 21:24     ` Victor Porton
2017-07-12 17:09       ` Paul Rubin
2017-07-12 17:39         ` Victor Porton [this message]
2017-07-13  6:35           ` Paul Rubin
2017-07-11  9:42   ` J-P. Rosen
2017-07-11 12:52     ` Victor Porton
2017-07-11 13:01       ` Victor Porton
2017-07-11 13:26         ` J-P. Rosen
2017-07-11 16:04           ` Dennis Lee Bieber
2017-07-11 16:59           ` Dmitry A. Kazakov
2017-07-11 19:52             ` Pascal Obry
2017-07-11 20:18               ` Dmitry A. Kazakov
2017-07-11 18:36           ` Victor Porton
2017-07-11 19:22             ` J-P. Rosen
2017-07-11 20:25               ` Dmitry A. Kazakov
2017-07-11 23:19                 ` Victor Porton
2017-07-12  4:54                   ` J-P. Rosen
2017-07-12 13:07                     ` Victor Porton
2017-07-12 13:38                       ` Dmitry A. Kazakov
2017-07-12  5:35                   ` Randy Brukardt
2017-07-12  7:27                     ` Dmitry A. Kazakov
2017-07-12 22:47                     ` Shark8
2017-07-16 13:11                       ` Robert Eachus
2017-07-17 23:54                       ` Randy Brukardt
2017-07-18  7:38                         ` Dmitry A. Kazakov
2017-07-12  7:19                   ` Dmitry A. Kazakov
2017-07-12  6:35                 ` G.B.
2017-07-12  7:34                   ` Dmitry A. Kazakov
2017-07-12 20:49                     ` G.B.
2017-07-13  8:18                       ` Dmitry A. Kazakov
2017-07-12 17:34           ` Paul Rubin
2017-07-11 19:27         ` Simon Wright
2017-07-12  5:42     ` darkestkhan
2017-07-12  8:57     ` Maciej Sobczak
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox