What is the difference between fn and fn*?

二次信任 提交于 2019-12-22 04:01:47

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/12488479/what-is-the-difference-between-fn-and-fn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!