Consider implementing DATA + READ
skx opened this issue · comments
Steve Kemp commented
We could scan the program for DATA-statements at load-time, much like we do for line-numbers. Assume our Interpreter object had:
dOffset := 0
data = []int
Every time we see READ we just return the next value, it is (obviously) a fatal error to read too much.
Sample program(s) here:
NOTE: Because READ
needs a reference to variables we have to put it in our core. Similarly DATA needs to be in our core.