Statement "goto" between functions

CasparKielwein Caspar at Kielwein.de
Sun May 26 13:26:38 UTC 2019


On Saturday, 25 May 2019 at 19:29:03 UTC, Andrey wrote:
> Hello,
> Can anybody say - is it possible to implement in D a statement 
> "goto between functions". Not between random functions but 
> between functions that are currently on the stack. Such "goto" 
> will be something like labeled break in nested loops.
> (...)
> What do you think?

If I understand you correctly, you basically want coroutines.
D offers a library implementation called Fibers: 
https://dlang.org/library/core/thread/fiber.html
They allow switching between arbitrary stack like contexts, which 
should enable your algorithm.


More information about the Digitalmars-d mailing list