Infinite fibonacci sequence, lazy take first 42 values
Ali Çehreli
acehreli at yahoo.com
Thu Apr 21 03:41:24 UTC 2022
On 4/20/22 19:11, Alain De Vos wrote:
> Maybe there are multiple solutions ?
Indeed. :)
I have a Range struct here:
http://ddili.org/ders/d.en/ranges.html#ix_ranges.infinite%20range
Another one with fibers here:
http://ddili.org/ders/d.en/fibers.html
The same chapter uses Generator:
http://ddili.org/ders/d.en/fibers.html#ix_fibers.Generator,%20std.concurrency
And Phobos has an example here:
https://dlang.org/library/std/range/recurrence.html
Ali
More information about the Digitalmars-d-learn
mailing list