What is fn* and how does Clojure bootstrap?

ⅰ亾dé卋堺 提交于 2019-12-04 09:59:01

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/10767305/what-is-fn-and-how-does-clojure-bootstrap

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