Re:A function decorator that rewrites the bytecode to enable...
by framecowbird on Tuesday September 21, 2021 @06:53AM
(#28603750)
But you can also do that with recursion
if failed: do_thing()
This is covered in the Julia docs, where they argue recursion is more readable than goto
https://sodocumentation.net/julia-lang/topic/5564/-goto-and-...
Re:A function decorator that rewrites the bytecode to enable...
by withinboredom on Tuesday September 21, 2021 @06:56AM
(#28603758)
I guess that depends on if the language supports tail recursion and/or you're 100% sure it won't blow the stack. If you need to retry forever, without using any memory to do so, goto is perfect.
Is much more elegant than a loop, or at least easier to read since you only need to really pay attention to the happy path.