Hacker News new | ask | show | jobs
by ratboy666 1172 days ago
The pinnacle... huh.

What about assigned goto? hollerith?equivalence? Please look at the following:

C THE CALLEE

SUBROUTINE X(I)

GO TO I

END

C THE CALLER ASSIGN 10 TO J

CALL X(J)

C THIS IS NEVER REACHED STOP 10 WRITE(3,100)

100 FORMAT(8H THIS IS)

END

Why would this work? Because recursive calls are not allowed, There should NOT be a stack. So allow rather arbitrary jumped around (setjmp/longjmp) is um... ok?!? And what happens if a normal integer is passed to that code? (and it is separately compiled). Yikes.

1 comments

Or, with proper formatting:

  C    THE CALLEE
       SUBROUTINE X(I)
         GO TO I
       END
  C    THE CALLER 
       ASSIGN 10 TO J
       CALL X(J)
  C    THIS IS NEVER REACHED 
       STOP 
   10  WRITE(3,100)
   100 FORMAT(8H THIS IS)
       END