Re:A function decorator that rewrites the bytecode to enable...
by hamilyon2 on Tuesday September 21, 2021 @10:59AM
(#28605686)
Exceptions are forward gotos. A "while" loop with continue and break is backward goto.
The only thing missing is break from nested while. Java has one, called break with label, one of more obscure features of language.
So, in a sense, python already does have goto.
[ Parent
| on HN ]
Re:A function decorator that rewrites the bytecode to enable...
by Spivak on Tuesday September 21, 2021 @11:24AM
(#28605960)
All control flow constructs in modern programming languages are about codifying the safe uses of goto and setjmp.
For example defer and friends are goto cleanup; and yield and exceptions are setjmp.