23

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?

Maybe this has already been asked? I am having a hard time getting good search results for fn*.

update: Changed "bootstrap itself" to "bootstrap" in title, because I didn't want to imply Clojure was self-hosting.

4

1 回答 1

12

在 src/jvm/clojure/lang/Compiler.java 46 行:

static final Symbol FN = Symbol.intern("fn*");

fn* 由 clojure 编译器实现,我猜是其他特殊形式。

更新: 在 analyzeSeq 方法中,6452-6353 行:

    if(op.equals(FN))
        return FnExpr.parse(context, form, name);

请查看 FnExpr 类实现代码。

于 2012-05-26T15:34:12.253 回答