The Misp Chronicles II: Writing

Since you can’t do much in a world with primitive points, Misp needs a way to construct things out of those points. The simplest construction is to just make pairs of things. We write pairs by putting a dot between the two parts and wrapping the whole thing in parenthesis. For example, the pair of hello and world is (hello . world). Since we use dots and parenthesis in writing a pair, we won’t use them as symbols. Same goes for parenthesis.

When we make pairs that have nil on their right side, we can leave off both the dot and nil. For example, in place of (surprise! . nil) we can write (surprise!). Similarly, when we pair something with a pair, we can leave off the dot and the the parenthesis around the tail. For example, in place of (fantastic . (surprise!)), we can write (fantastic surprise!). Or in place of (has . (a . (dangling . tail))), we can write (has a dangling . tail). Once we start writing a lot of things, these conventions will become very useful.

Why write (eq . ((hd . ((hd . (env . nil)) . nil)) . (key . nil))) when (eq (hd (hd env)) key) is simpler and just as unambiguous?