On 2016-09-24 15:12, Nick Sabalausky wrote:
+1.
Although I haven't given it too much thought, I'd bet that could also be
used to provide, in library, my #1 most wanted missing D feature: Input
ranges (maybe even forward, too) written as stackless coroutines
(C#-style, heck, even C can do it in lib). So we could write input
ranges without turning the whole freaking algorithm completely
inside-out, or requiring the overhead of a full fiber.
Yeah, I've been thinking of that as well. It should be fairly easy to
implement something like Protothreads [1]. Not sure about stackless
coroutines though, if they need to save the state of the function on
suspension and restore the state when the function resumes.
[1] http://dunkels.com/adam/pt/
--
/Jacob Carlborg