in reply to Re^5: Weird syntax. What does this goto statement do? ( 'goto &NAME' use cases)
in thread Weird syntax. What does this goto statement do?
And I can't deal with your C code either, especially as it's far from short.
But I looked into the WP page for Coroutines which has an abstract definition and boils it down to two simple criteria which can be very easily mapped to Perl.
The first yield-to example with routines translates 1to1
The next example showing a generator is a bit more complex, it requires to store the exit point in a closure-var as lable-name and to goto to that lable after rentry.
This is essentially the semantic of gather-take in Perl6
NB: I didn't say using goto &NAME and goto LABEL are efficient.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
The post I replied to was considerably extended while I wrote this
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Weird syntax. What does this goto statement do? ( 'goto &NAME' use cases)
by ikegami (Patriarch) on Jan 04, 2024 at 14:58 UTC |