Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is fn* and how does Clojure bootstrap?

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.

like image 956
andrew cooke Avatar asked May 26 '12 15:05

andrew cooke


1 Answers

in src/jvm/clojure/lang/Compiler.java 46 line:

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

fn* implement by clojure compiler, as others special form, I guess.

Update: in analyzeSeq method, 6452-6353 line:

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

please check out FnExpr class implement code.

like image 121
number23_cn Avatar answered Nov 22 '22 20:11

number23_cn