Clojure 被认为是Lispy 还是Schemy?
Clojure 是一种在 JVM 上运行的 Lisp 方言。
Clojure 被认为是Lispy 还是Schemy?
我的意思是它像Lisp 还是像Scheme?
Possible Duplicate:
Is Clojure closer to Scheme or Common Lisp from a beginner's perspective?
Clojure is a Lisp dialect that runs on the JVM.
Is Clojure considered Lispy or Schemey?
I mean is it like Lisp or like Scheme?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果“Lispy”你的意思是“像 Common Lisp”,那么...
Clojure 是“Lispy”,因为它具有完整的(非卫生的)宏并且不保证尾部调用优化(除了
recur
)。Clojure 是“Schemey”,因为它对函数和值都有一个命名空间(它是 Lisp-1)。
If by "Lispy" you mean "like Common Lisp," then...
Clojure is "Lispy" because it has full (nonhygienic) macros and doesn't guarantee tail-call optimization (except with
recur
).Clojure is "Schemey" because it has a single namespace for both functions and values (it is a Lisp-1).
Lisp 主要有两个含义:
从这个意义上说,Scheme、Clojure、Emacs Lisp、Common Lisp、Logo ……都有些“Lispy”。
人们可以看到,只需对 Common Lisp 进行很少的更改,就可以运行几十年前的 Lisp 代码。
从这个角度来看,Scheme 和 Clojure 都不是特殊的“Lispy”,因为它们与“主要分支”和历史悠久的 Lisp 广泛不兼容。
Clojure 是一种新的 Lisp 方言,与所有其他 Lisp 以及历史悠久的 Lisp 几乎不兼容。功能名称、标识符、语法等都不同。在我看来,它与 CL 的距离与与 Scheme 的距离一样远。
Lisp has mainly two meanings:
In this sense Scheme, Clojure, Emacs Lisp, Common Lisp, Logo, ... are all somewhat 'Lispy'.
One can see that it is possible to run decades old Lisp code with very few changes in Common Lisp.
In this view, neither Scheme nor Clojure are particular 'Lispy', since they are widely incompatible with the 'main branch' and with the historic Lisp.
Clojure is a new Lisp dialect that is mostly incompatible with all other Lisps and also with the historic Lisp. Names of functionality, identifiers, syntax, etc. are all different. In my view it is as far from CL as it is from Scheme.
当人们说“Schemey”时,他们往往指的是“Lisp-1”与“Lisp-2”,这是历史上的区别。 Clojure 在这方面就很狡猾。
但除此之外,Clojure 在风格上更像是非常现代的 lisp 情感。这种现代风格中 clojure 最著名的前身可能是 Arc。如果有的话,Clojure 是 arc-ish:它更喜欢减少嵌套深度的构造(参见 clojure 和 arc let 与 common lisp 或 schema let);两者都是不同的运行时,嵌套在更大、更通用的解释器运行时中,免费提供更大的库;并且两者都重视名称的简洁性,而不是常见的 lisp 规范中极其长的名称(例如,多值绑定)。
Clojure 是弧形的。
When people say "Schemey" they tend to mean "Lisp-1" vs. "Lisp-2", which is historically the distinction. Clojure is schemey in that fashion.
But beyond those, Clojure is stylistically more like very modern lisp sensibilities. Probably the most notable predecessor to clojure in this modern style is Arc. If anything, Clojure is arc-ish: it prefers constructs with reduced nesting depth (see clojure and arc let vs. common lisp or scheme let); both are distinct runtimes nested within larger, more generic interpreter runtimes that give a larger library for free; and both value brevity in names as opposed to the insanely long names in the common lisp spec (e.g., multiple-value-bind).
Clojure is arc-ish.