[comp.lang.c] setjmp, longjmp, goto

karl@haddock.ISC.COM (Karl Heuer) (08/22/87)

In article <2196@xanth.UUCP> kent@xanth.UUCP (Kent Paul Dolan) writes:
>[Symbolics machines require that setjmp be a builtin]

There's an interesting connection between this and my earlier ramblings about
label variables and pointers.  If labels were real objects (with declarations,
etc.), perhaps "long label" could be a variant that includes the stack info
for non-local gotos.  Then "jmp_buf" becomes "long label", "if (setjmp(j))"
becomes "come_from = 0; j: if (come_from)", and "longjmp(j, x)" becomes
"come_from = x; goto j".

Naaaah.  (Maybe if I were designing a new language from scratch...)

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint