comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Iterators in Ada2012
Date: Fri, 25 Nov 2011 15:20:12 +0100
Date: 2011-11-25T15:20:12+01:00	[thread overview]
Message-ID: <op.v5h93yeuule2fv@douda-yannick> (raw)
In-Reply-To: 4eba5c38$0$6560$9b4e6d93@newsspool4.arcor-online.net

Le Wed, 09 Nov 2011 11:55:52 +0100, Georg Bauhaus  
<rm-host.bauhaus@maps.futureapps.de> a écrit:
> 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 := Produce_Next;
>        accept Next (Result : out Value_Type) do
>           Result := Current;
>        end Next;
>     end loop;
> end Generator;

The good time for a question: Are coroutines planned for Ada 2020 ?


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: [Epigrams on Programming — Alan J. — P. Yale University]



  reply	other threads:[~2011-11-25 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 10:05 Iterators in Ada2012 comp.lang.php
2011-11-08 13:13 ` Georg Bauhaus
2011-11-08 13:42   ` Dmitry A. Kazakov
2011-11-09  4:12   ` R. Tyler Croy
2011-11-09  9:02     ` Simon Wright
2011-11-09 22:58       ` R. Tyler Croy
2011-11-10  8:07         ` Georg Bauhaus
2011-11-09 10:55     ` Georg Bauhaus
2011-11-25 14:20       ` Yannick Duchêne (Hibou57) [this message]
2011-11-08 21:25 ` Randy Brukardt
replies disabled

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