Mastering Clojure Macros: Write Cleaner, Faster, Smarter Code (Paperback)
暫譯: 精通 Clojure 巨集:撰寫更乾淨、更快速、更智能的程式碼 (平裝本)
Colin Jones
- 出版商: Pragmatic Bookshelf
- 出版日期: 2014-09-30
- 售價: $900
- 貴賓價: 9.5 折 $855
- 語言: 英文
- 頁數: 122
- 裝訂: Paperback
- ISBN: 1941222226
- ISBN-13: 9781941222225
-
相關分類:
JVM 語言
已絕版
買這商品的人也買了...
-
$620$490 -
$980$833 -
$980$774 -
$420$357 -
$550$435 -
$590$502 -
$340$269 -
$780$616 -
$360$306 -
$820$541 -
$880$695 -
$199$169 -
$980$774 -
$780$616 -
$390$257 -
$500$425 -
$520$411 -
$580$458 -
$480$408 -
$948$901 -
$480$408 -
$650$553 -
$680$537 -
$520$442 -
$450$297
相關主題
商品描述
Level up your skills by taking advantage of Clojure's powerful macro system. Macros make hard things possible and normal things easy. They can be tricky to use, and this book will help you deftly navigate the terrain. You'll discover how to write straightforward code that avoids duplication and clarifies your intentions. You'll learn how and why to write macros. You'll learn to recognize situations when using a macro would (and wouldn't!) be helpful. And you'll use macros to remove unnecessary code and build new language features.
Clojure offers some sharp tools in its toolbox, and one of the sharpest is its macro system. This book will help you write macros using Clojure, and more importantly, recognize when you should be using macros in the first place.
The Lisp "code-as-data" philosophy gives tremendous advantages to macro authors and users. You can use macros to evaluate code in other contexts, move computations to compile time, and create beautiful API layers. You don't need to wait on the Clojure language itself to add new features, you'll learn how to implement even the lowest-level features as macros. You'll step through representative samples of how to use macros in production libraries and applications, find clear details on how to construct macros, and learn pointers to avoid obstacles that often trip up macro amateurs.
Clojure macros are more straightforward to use than metaprogramming features in many other languages, but they're different enough from normal programming to present challenges of their own. Mastering Clojure Macros examines some of these issues, along with alternatives to macros where they exist.
By the time you finish this book, you'll be thinking like a macro professional.
What You Need:The book examples have been developed under Clojure 1.6.0, although earlier and later versions of Clojure may work as well. You'll want to use Leiningen 2.x in order to follow along with the examples that use external projects.
商品描述(中文翻譯)
提升你的技能,充分利用 Clojure 強大的宏系統。宏讓困難的事情變得可能,讓普通的事情變得簡單。使用宏可能會有些棘手,而這本書將幫助你靈活地駕馭這片領域。你將發現如何編寫簡潔的代碼,避免重複並清晰表達你的意圖。你將學習如何以及為什麼要編寫宏。你將學會識別使用宏的情況(以及不應該使用的情況!)。你將使用宏來移除不必要的代碼並構建新的語言特性。
Clojure 提供了一些尖銳的工具,而其中最尖銳的就是它的宏系統。這本書將幫助你使用 Clojure 編寫宏,更重要的是,幫助你識別何時應該使用宏。
Lisp 的「代碼即數據」哲學為宏的作者和使用者提供了巨大的優勢。你可以使用宏在其他上下文中評估代碼,將計算移至編譯時,並創建美麗的 API 層。你不需要等待 Clojure 語言本身添加新特性,你將學會如何將即使是最低層級的特性實現為宏。你將逐步了解如何在生產庫和應用中使用宏的代表性範例,找到構建宏的清晰細節,並學習避免常常讓宏初學者絆倒的障礙的提示。
Clojure 的宏比許多其他語言中的元編程特性更容易使用,但它們與普通編程有足夠的不同,會帶來自身的挑戰。《Mastering Clojure Macros》探討了這些問題,以及存在的宏的替代方案。
當你完成這本書時,你將像一位宏專家一樣思考。
你需要的:本書範例是在 Clojure 1.6.0 下開發的,雖然早期和後期版本的 Clojure 也可能適用。你將需要使用 Leiningen 2.x 來跟隨使用外部專案的範例。