I forget which Atari BBS it was that I used to dial in a lot to, but a buddy of mine ran one and I got to look at the BASIC source code.
IIRC, a large number of single digit constants were stored as variables to save memory since each use of one took up more memory than referencing the variable, and further it used something along the lines of Peano numbers and the fact booleans were represented as numbers to create them. Something like:
10 LET D0 = 0
20 LET D1 = (D0 = D0) <== some boolean that evaluated to true/1. I may have this backwards
30 LET D2 = D1 + D1
40 ...
I forget the details, but when all was said and done, when you ran the BBS there was zero free memory; not a single byte.