|
|
|
|
|
by foobar_
2167 days ago
|
|
Congrats on the book! If you are just going to use `TAGBODY` and `GO` to implement this ... in a goto based languages like C I don't think you would be needing a condition system. In C a nested function can also jump into a parents goto label. No one probably uses it, but just saying! Also how similar is this to promises in javascript ? |
|
It positively cannot, because,
1. There is no such thing as a nested function in ISO C. It's a GCC extension.
2. Let's try it the GCC extension:
This does not compile: Maybe you can use a computed label and pass it as an argument? Well, that compiles now but: In addition to Common Lisp: another notable language which can do this is PL/I. To tie this a bit more to the topic, PL/I is incidentally where conditions come from, including the "condition" terminology.