Clojure 被认为是Lispy 还是Schemy?

发布于 2024-10-02 05:57:08 字数 341 浏览 3 评论 0原文

可能的重复:
Clojure 更接近于 Scheme 或 Common Lisp从初学者的角度来看?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雪落纷纷 2024-10-09 05:57:08

如果“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).

无尽的现实 2024-10-09 05:57:08

Lisp 主要有两个含义:

  • Lisp 是一个编程语言家族,从 1958 年最初的 Lisp 开始。

从这个意义上说,Scheme、Clojure、Emacs Lisp、Common Lisp、Logo ……都有些“Lispy”。

  • Lisp 是一个语言家族,有一个主要分支:Lisp、Lisp 1.5、MacLisp、Lisp Machine Lisp、Common Lisp。

人们可以看到,只需对 Common Lisp 进行很少的更改,就可以运行几十年前的 Lisp 代码。

从这个角度来看,Scheme 和 Clojure 都不是特殊的“Lispy”,因为它们与“主要分支”和历史悠久的 Lisp 广泛不兼容。

Clojure 是一种新的 Lisp 方言,与所有其他 Lisp 以及历史悠久的 Lisp 几乎不兼容。功能名称、标识符、语法等都不同。在我看来,它与 CL 的距离与与 Scheme 的距离一样远。

Lisp has mainly two meanings:

  • Lisp is a family of programming language, starting with the original Lisp in 1958.

In this sense Scheme, Clojure, Emacs Lisp, Common Lisp, Logo, ... are all somewhat 'Lispy'.

  • Lisp is a family of language with one main branch: Lisp, Lisp 1.5, MacLisp, Lisp Machine Lisp, Common Lisp.

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.

伴我老 2024-10-09 05:57:08

当人们说“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文