Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Function definition of Clojure built-ins: def vs defn

Why are some (many) of Clojure's built-in functions defined using def, not defn?

I know that defn is a shortcut for def, but I'm wondering if there's some other reason such as efficiency/readability/style considerations/bootstrapping.

like image 399
Matt Fenwick Avatar asked Nov 03 '11 21:11

Matt Fenwick


1 Answers

Read further down in clojure/core.clj - defn doesn't exist yet at the top, because that file is building the language as it goes. After several hundred lines, defn is written, and functions after that are defined with defn.

like image 186
amalloy Avatar answered Oct 16 '22 15:10

amalloy