什么是fn *和Clojure如何引导? [英] What is fn* and how does Clojure bootstrap?

查看:97
本文介绍了什么是fn *和Clojure如何引导?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆