Hacker News new | ask | show | jobs
by wang_li 889 days ago
How do you speculate GOTO works if the tokenized program doesn’t have line numbers? Or if I write

     5 REM MY COOL PROGRAM
    10 PRINT “HELLO” 
    20 GOTO 10
Then later I write

    10 PRINT “DIE BART DIE”
How does it know to replace the right line?
2 comments

The line number is stored in the program, just not as text. It's preparsed into a (usually 16-bit) integer as part of the 'tokenization' of the input line buffer.
i don't think that flohofwoe was claiming the line numbers weren't stored, just that the textual representation with line numbers maybe isn't the correct measure