Is there any way to have a yieldable function that can be resumed at a later time in D?

Some thing like:

void test()
{
     writeln("A");
     yeild();
     writeln("B");
}

...

auto x = yieldable!test();
x.resume(); // prints "A"
x.resume(); // prints "B"
x.resume(); // throws an error or something, i dont know..


Also how portable is the built in asm support, was thinking about implementing this if it's not already available. Also is there a way to define naked functions in D? I think not but they might make implementing this a little more simple.

Reply via email to