Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Which dialects?? A stack is the obvious thing to have. You'll already need something like for nested FOR loops, so it's the obvious thing to do for GOSUB as well. I'd be surprised to hear that any non-toy implementations didn't have a GOSUB/RETURN stack.

ZX81 BASIC has a GOSUB/RETURN stack. MS BASIC has a GOSUB/RETURN stack. Atari BASIC has a GOSUB/RETURN stack. Apple 1 BASIC has a GOSUB/RETURN stack! - sure, it appears to be all of 8 deep, so good luck with using it for anything recursive, but it's a stack nonetheless...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: