Proposal idea - generators

Neal Gafter neal at gafter.com
Wed Apr 1 14:56:34 PDT 2009


On Wed, Apr 1, 2009 at 2:41 PM, Neal Gafter <neal at gafter.com> wrote:
> On Wed, Apr 1, 2009 at 1:34 PM, Howard Lovatt <howard.lovatt at iee.org> wrote:
>> Note I am not
>> proposing, and I don't believe the original poster was either, a
>> continuation style yield. More a Scala and other non-lazy functional
>> language style were the results are stored in a Map and the Map is
>> returned, i.e. like applying (mapping) a function to each element of a
>> list but with more control (in particular break and continue
>> functionality).
>
> Scala's comprehensions using their standard libraries are lazy.  See,
> for example, Iterator.range.  C#'s iterator methods are translated
> into a state machine (i.e. coroutines) and are inherently lazy.  F#
> and OCaml are the most widely used non-lazy functional languages, but
> their comprehensions are lazy too.  So I'm not sure what you're saying
> your proposal is comparable to.

I may be wrong about OCaml's generators.



More information about the coin-dev mailing list