skx / gobasic

A BASIC interpreter written in golang.
https://blog.steve.fi/tags/basic/
GNU General Public License v2.0
323 stars 27 forks source link

Move eval/builtin* to their own package. #56

Closed skx closed 5 years ago

skx commented 5 years ago

We could test each built-in in isolation, of course we'd need to drop the reference to the interpreter-object - which is yet another change to our signature. Sigh.

skx commented 5 years ago

I took a stab at this last night; 99% is fine, but we'll get an import loop if we try to pass an interpreter to the builtin-functions.

Turns out we could almost drop that - it is only our HTTP-server which sets a variable (in the SAVE primitive) which requires it.

Suggestion: