Skip to content

Instantly share code, notes, and snippets.

@mszajna
Created November 2, 2020 19:33
Show Gist options
  • Save mszajna/4ff83117f05b94418be21eb28ece4c78 to your computer and use it in GitHub Desktop.
Save mszajna/4ff83117f05b94418be21eb28ece4c78 to your computer and use it in GitHub Desktop.
Bootstrapping def
(let* [list (. clojure.lang.PersistentList creator)
mydef (fn* [&form &env sym val] (list 'clojure.lang.Var/intern `*ns* (list 'quote sym) val))]
(clojure.lang.Var/intern *ns* (quote mydef) mydef)
(. (var mydef) (setMacro)))
(mydef a 1)
=> #'user/a
a
=> 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment