> On Apr 19, 2017, at 3:28 PM, Mark Morgan Lloyd 
> <markmll.fpc-pas...@telemetry.co.uk> wrote:
> 
> It is possible to partially-simulate coroutines with setjmp/longjmp, but you 
> need to store state outside the function. The key thing about coroutines, at 
> least as implemented by Wirth in Modula-2, is that you can transfer 
> arbitrarily between them i.e. it's not just a case of a scheduler selecting 
> one specific task which runs and then returns.

I only used coroutines in Lua and they were basically a way for a control 
structure like a loop to return control the main program without using 
threading. From the descriptions it sounds like longjmp moves the current point 
of execution of the program (if that concept exists like I imagine it does) so 
you could step in and out of loops or functions. If not that then what do those 
functions actually do?

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to