什么是fn *和Clojure如何引导? [英] What is fn* and how does Clojure bootstrap?
问题描述
clojure.core的源代码似乎假设 fn *
的预先存在。这是什么定义的?引导需要什么(对现有的Java类型)?它如何整合在一起?
The source for clojure.core appears to assume the pre-existence of fn*
. Where is this defined? What else is needed for bootstrap (over existing Java types)? How is it all put together?
也许这已经被问过了吗?我很难为 fn *
获得良好的搜索结果。
Maybe this has already been asked? I am having a hard time getting good search results for fn*
.
更新:改变bootstrap本身为标题中的bootstrap,因为我不想暗示Clojure是自托管的。
update: Changed "bootstrap itself" to "bootstrap" in title, because I didn't want to imply Clojure was self-hosting.
推荐答案
p> in src / jvm / clojure / lang / Compiler.java 46 line:
in src/jvm/clojure/lang/Compiler.java 46 line:
static final Symbol FN = Symbol.intern("fn*");
fn *由clojure编译器实现,因为其他特殊形式,我猜。
fn* implement by clojure compiler, as others special form, I guess.
更新:
在analyzeSeq方法中,6452-6353行:
Update: in analyzeSeq method, 6452-6353 line:
if(op.equals(FN))
return FnExpr.parse(context, form, name);
请检查FnExpr类实现代码。
please check out FnExpr class implement code.
这篇关于什么是fn *和Clojure如何引导?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!