(Not an Answer, but rather a way too long comment on the target)
The reason: I'm interested in running statistical measures against a large library of code to find the distribution of variable names, constants and so forth in an effort to improve a BASIC parser.
Using (very) old code to optimize a modern parser might be a less than good input - at least if the parser is meant to be used in actual (modern) programming.
Old BASICs had many quirks when it came to variable naming:
- Most prominent the two letter restriction of most MS BASIC.
- Others could just a single letter.
Both made programmers use rather cryptic names (*1), something that wouldn't happen with a BASIC capable of handling (more) meaningful names.
- Then there were BASICs that requited the use of pseudo-arrays for certain variables - like A() holding all strings.
But beside source level reasons, there where many run time effects that influenced variable use back then, like
- like reuse of variables for speed
- reuse is faster than adding a new, as it reduces search time
- placement of often used variables at program start for speed up
- forcing their search time down
Other tricks include putting
- multiple single values in an array
- multiple arrays into a single array
Both relay on the fact that array access is (may be) faster in MS BASIC than accessing single variables (*2).
In addition to all of this, these lovable early books where even more restricted, as they tried to go along with an even more restricted BASIC standard than MS BASIC is - like using only single letter variable names.
All of this are methods that where quite popular back then and would never be used today - at least if the BASIC offers such conveniance as long variable names and more generic handling.
Bottom line: If your parser is meant to be used for actual (new) programs, using (very) old programs may lead to an optimization for cases no longer present.
*1 - More than once resulting in unintended reuse when the same abbreviation was used twice for different meanings - especially nasty when this happened in originally non overlapping sections, but later changes/extensions made them overlapping. A fricking hell to find this in large programs with tools of the time (aka almost none).
*2 - Arrays are stored separate from simple variables. When accessing a simple variable the whole list is searched until the variable is found. With arrays the array itself is as well searched in the array list (which usually is shorter) followed by an indexed access to the variable itself, speeding access quite a lot.
Q$
".