Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between fn and fn*?

Tags:

clojure

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?

like image 283
Doug Richardson Avatar asked Sep 19 '12 04:09

Doug Richardson


1 Answers

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.

like image 158
sepp2k Avatar answered Sep 20 '22 02:09

sepp2k