Interesting: <a href="https://github.com/robpike/lisp/blob/master/lisp1_5/parse.go#L24" rel="nofollow">https://github.com/robpike/lisp/blob/master/lisp1_5/parse.go...</a><p><pre><code> // Expr represents an arbitrary expression.
type Expr struct {
// An Expr is either an atom, with atom set, or a list, with car and cdr set.
// Car and cdr can be nil (empty) even if atom is nil.
car *Expr
atom *token
cdr *Expr
}
</code></pre>
Instead of using interface types for expressions, there is a simple expression structure type with fields that may or may not be set depending on what type of value it is.<p>I probably never would have done it that way, I would probably use an interface type instead. This way actually saves space in cons objects… in the above version, a cons is 24 bytes, and below it would be 32:<p><pre><code> type Expr interface { }
type Cons struct { car, cdr Expr }
</code></pre>
Not efficient compared to modern Lisp interpretations, but an interesting choice.