4 ms·
I have no idea if this is actually the case with early Lisp, but when I was making my own vaguely Lisp-alike interpreter, it became awfully tempting to make eve
by Drakim 3y ago
I have no idea if this is actually the case with early Lisp, but when I was making my own vaguely Lisp-alike interpreter, it became awfully tempting to make everything into a list. After all, arrays are lists, strings are lists of characters, and even structs can be thought of as a list with unorthodox indexing.
At one point I was faced with the fact that I only really had 2 datatypes in my interpreter, the list and the integer. So I bit the bullet and made my integer type into a list with one byte entry, thus reducing my total amount of datatypes to one. Every piece of my interpreter code always knew that it would get a list as inputs, and it was kinda beautiful. CPU-wise it was wasteful, but it reduced the interpreter size by a lot.