On Monday, 30 January 2017 at 11:03:52 UTC, Profile Anaysis wrote:
I need to yield from a complex recursive function too allow
visualizing what it is doing.
e.g., if it is a tree searching algorithm, I'd like to yield
for each node so that the current state can be shown visually.
I realize
On Tuesday, 31 January 2017 at 11:31:28 UTC, Ali Çehreli wrote:
On 01/31/2017 03:00 AM, Profile Anaysis wrote:
> [...]
[...]
> [...]
return type.
Options:
[...]
Thanks again!
On 01/31/2017 03:00 AM, Profile Anaysis wrote:
> Just curious, how can I use start() recursively?
[...]
> Seems I can't create start with a parameter and non-void return type.
Options:
- The class can maintain state
- You can start the fiber with a delegate;
int local;
double state;
On Tuesday, 31 January 2017 at 06:32:02 UTC, Ali Çehreli wrote:
On 01/30/2017 08:12 PM, Profile Anaysis wrote:
import std.stdio, std.concurrency, core.thread;
class Search : Fiber
{
this() { super(); }
int res = 0;
void start()
{
Fiber.yield();
res = 1;
}
}
On Tuesday, 31 January 2017 at 06:32:02 UTC, Ali Çehreli wrote:
On 01/30/2017 08:12 PM, Profile Anaysis wrote:
[...]
That's because the fiber is not in a callable state. (You can
check with search.state.) Here is one where the fiber function
lives (too) long:
import std.stdio,
On 01/30/2017 08:12 PM, Profile Anaysis wrote:
import std.stdio, std.concurrency, core.thread;
class Search : Fiber
{
this() { super(); }
int res = 0;
void start()
{
Fiber.yield();
res = 1;
}
}
void main()
{
auto search = new Search();
search.call();
On Monday, 30 January 2017 at 18:48:10 UTC, Ali Çehreli wrote:
On 01/30/2017 03:03 AM, Profile Anaysis wrote:
> I need to yield from a complex recursive function too allow
visualizing
> what it is doing.
>
> e.g., if it is a tree searching algorithm, I'd like to yield
for each
> node so that the
On Monday, 30 January 2017 at 22:34:11 UTC, TheFlyingFiddle wrote:
On Monday, 30 January 2017 at 11:03:52 UTC, Profile Anaysis
wrote:
I need to yield from a complex recursive function too allow
visualizing what it is doing.
e.g., if it is a tree searching algorithm, I'd like to yield
for
On Monday, 30 January 2017 at 11:03:52 UTC, Profile Anaysis wrote:
I need to yield from a complex recursive function too allow
visualizing what it is doing.
e.g., if it is a tree searching algorithm, I'd like to yield
for each node so that the current state can be shown visually.
I realize
On 01/30/2017 02:04 PM, cym13 wrote:
On Monday, 30 January 2017 at 18:48:10 UTC, Ali Çehreli wrote:
http://ddili.org/ders/d.en/fibers.html
BTW the alias to avoid a name conflic on "Generator" isn't necessary
anymore [...] Otherwise I believe you'll agree
that removing it would make it
On Monday, 30 January 2017 at 18:48:10 UTC, Ali Çehreli wrote:
On 01/30/2017 03:03 AM, Profile Anaysis wrote:
> I need to yield from a complex recursive function too allow
visualizing
> what it is doing.
>
> e.g., if it is a tree searching algorithm, I'd like to yield
for each
> node so that the
On 01/30/2017 03:03 AM, Profile Anaysis wrote:
> I need to yield from a complex recursive function too allow visualizing
> what it is doing.
>
> e.g., if it is a tree searching algorithm, I'd like to yield for each
> node so that the current state can be shown visually.
I used tree iteration as
On Monday, 30 January 2017 at 11:03:52 UTC, Profile Anaysis wrote:
I need to yield from a complex recursive function too allow
visualizing what it is doing.
e.g., if it is a tree searching algorithm, I'd like to yield
for each node so that the current state can be shown visually.
I realize
I need to yield from a complex recursive function too allow
visualizing what it is doing.
e.g., if it is a tree searching algorithm, I'd like to yield for
each node so that the current state can be shown visually.
I realize that there are several ways to do this but D a yield
version
14 matches
Mail list logo