bobbicodes / bobbi-lisp

Interactive Lisp environment for learning Clojure
https://bobbicodes.github.io/bobbi-lisp/
0 stars 0 forks source link

Auto-gensym #23

Open bobbicodes opened 11 months ago

bobbicodes commented 11 months ago

I believe this is to be implemented in the reader.

The macro system used in Mal (which this is based on) was modeled after Clojure, which in turn was modeled after Common Lisp, which means they are just regular functions that are marked as macros so they are evaluated differently. I did however make them define functions implicitly, rather than having to do (defmacro (fn ...)) to bring it closer to Clojure.

A big difference is that Clojure's syntax quote also does namespace resolution, which doesn't apply here because we don't have real namespaces. This makes gensym all the more important because like in CL, it's the main tool to prevent name collisions.