9

In Clojure, what is the difference between fn and fn*? I see fn* when I syntax quote a function created with the # macro. For example, in the REPL:

user=> `#(inc %)   
(fn* [p1__342__343__auto__] (clojure.core/inc p1__342__343__auto__))

Is this simply used for debugging purposes to identify that the function was created by # rather than fn directly?

Doug Richardson
  • 10,483
  • 6
  • 51
  • 77
  • 1
    See http://stackoverflow.com/questions/10767305/what-is-fn-and-how-does-clojure-bootstrap – noahlz Sep 19 '12 at 06:52

1 Answers1

17

According to this post on google groups fn* is a primitive form to create functions and fn is a macro built on top of it to implement higher-level features like destructuring.

sepp2k
  • 363,768
  • 54
  • 674
  • 675