We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
关于 Lisp 宏的经典书籍可能是 Paul Graham 的 On Lisp。虽然它使用了 Common Lisp,但如果您真正想查看它的宏,那么这并不重要,尽管 Clojure 在很多层面上都有所不同。 (首先,Clojure 是 Lisp-1。)
The quintessential book on Lisp macros is probably Paul Graham's On Lisp. It used Common Lisp, though, but that doesn't matter too much if what you really want to look at it macros, although Clojure's are different on a number of levels. (Clojure being a Lisp-1, to begin with.)
尽管它们都是针对 Common Lisp,但 Paul Graham 所著的《On Lisp》中有两本很棒的书(完整书可在 他的网站)和Let Over Lambda 道格·霍伊特。
两者中,On Lisp 更容易理解;尽管 Clojure 宏与 IIRC 的 hygienic 宏更相似,但您几乎肯定会从中学到一些东西。
Although they're both aimed at Common Lisp, two great books for this are On Lisp by Paul Graham (full book available free online at his website) and Let Over Lambda by Doug Hoyte.
Of the two On Lisp is more accessible; even though Clojure macros are IIRC more similar to Scheme's hygienic macros, you'll still almost certainly learn something from it.
《实用Common Lisp》这本书把Lisp宏解释的非常清楚。 Clojure 的宏与 Common Lisp 的宏非常相似,几乎您所学到的所有内容都可以继承。 《Let Over Lambda》虽然是一部有趣、有趣且富有创意的作品,但它使用 Lisp 宏的方式与大多数认真、经验丰富、实用的 Lisp 程序员使用它们的方式非常不同。我不建议使用“变形”宏(“了解”特定变量名称)。
The book "Practical Common Lisp" explains Lisp macros very clearly. Clojure's macros are similar enough to those of Common Lisp that pretty much all of what you'd learn would carry over. "Let Over Lambda", while a fun, interesting, and creative work, uses Lisp macros very differently from the way they're used by most serious, experienced, practical Lisp programmers. I don't recommend the use of "anamorphic" macros (that "know" about specific variable names).
Michael Fogus 即将出版的书 The Joy of Clojure(可通过 Manning 的早期访问计划获取)中有关于宏的精彩章节。这是一本出色的书,解释了函数式编程背后的思维方式,不仅解释了 Clojure 的功能(包括最新的 1.2 更改)如何实现,还解释了为什么要这样实现。
关于宏的章节解释了 Clojure 中宏的以下用例、如何实现它们以及如何处理它们:
Michael Fogus' upcoming book The Joy of Clojure, available through Manning's Early Access Program, has a good chapter on macro's. It's an excellent book explaining the mindset behind functional programming, and not only how, but also why Clojure's features (including the newest 1.2 changes) are implemented the way they are.
The chapter on macro's explains the following use cases for macro's in Clojure, how they can be implemented, and how they are processed:
它不完全是一本通用的宏编写书,但 AMOP 演示了如何将宏用作库/框架的“视图”层。
(嗯,我没有很好地描述这一点。AMOP 是一本无法分类的书!)
It's not exactly a general-purpose macro-writing book, but AMOP demonstrates how to use macros as a 'view' layer for a library/framework.
(Hmm, I'm not doing a very good job describing this. AMOP is a book which kind of defies categorization!)