On Mon, Dec 10, 2018 at 1:21 PM John R. Hogerhuis <[email protected]> wrote:

> In other languages you can't call into the middle of a function. There is
> one entry point, possibly multiple exit points. There's no chance
> unbalanced CALL and RETURN. once you return you're jump to the stacked
> address and you're no longer in the subroutine.
>

For what it's worth, you certainly can do this in C.  ...And it woks fine
if the place you jump to is in a function with the same size/number of
parameters passed in (pushed onto the stack).  Although optimizations that
the compiler does might screw with that. ;)

By no means is it recommended or even slightly good practice though. ;D

A somewhat similar weird goto-thing is Duff's Device, where you jump into
the middle of a loop...
https://en.wikipedia.org/wiki/Duff%27s_device

Not to be confused with Mill's Mess or Burke's Barrage, which are juggling
patterns. ;D

-s

-s

Reply via email to