3 ms·
In most 8-bit BASIC interpreters, the LIST command is, actually, a pretty printer: it reads and parses the tokenized source from memory and outputs it to the "t
by rbanffy 6y ago
In most 8-bit BASIC interpreters, the LIST command is, actually, a pretty printer: it reads and parses the tokenized source from memory and outputs it to the "terminal". On the Apple II, for instance, we see upper-case versions with added spaces for clarity (and some annoyance for editing the on-screen code on very long lines).
It just occurred to me we missed an opportunity there, with computers that could display some form of screen attributes (Atari, VIC-20, C-64 and countless text terminals), to make use of color and typography to enhance screen presentation with a negligible cost in ROM.
It'd have been really cool to have color syntax highlighting on 8-bit computers in the late 70's...
- photokandy 6y agoOMG--that would have been SO nice to have. I don't think I got my first taste of syntax highlighting until I got access to Turbo Pascal. Adding it to Retroputer BASIC should be trivial. I think I'll have a go at it tonight, since it has support to use control codes to change the text color.
- pmiller2 6y agoThat's true, but it's typically not a very nice pretty printer. For example, I don't know of any old school version of BASIC where the LIST command shows any sort of indentation.
- photokandy 6y agoA quick search indicates that BBC Basic had a LISTO command that could add indents. I should see if I can add something similar.