Clojure编程

Chas Emerick

出版时间

2013-03-25

ISBN

9787121197185

文件格式

EPUB

评分

★★★★★

标签

编程

内容简介

这是一本让有经验的程序员又爱又恨的Clojure指南。它不满足于教你语法,而是试图重塑你对编程的底层认知:把函数当作一等公民、让数据不可变、用宏去扩展语言本身。书中最见功力的,是第4章对并发与状态的处置——在JVM上处理多线程,它提供原子、引用、代理等机制,把

作者简介

作者介绍: Chas Emerick是软件公司Snowtide informatics的创始人。自2008年以来,致力于Clojure语言本身以及一些开源项目的开发;长期在cemerick.com撰写Clojure、软件开发实践、创业精神,及其他主题的文章。 Brian Carpe r是一位心理学研究领域的专业程序员,用Clojure从事数据分析与web开发。他开发过一个把Clojure代码转化为CSS代码的编译器以及一个操作关系型数据库的类库,经常在briancarper.net上发表Clojure文章。 Christophe Grand是一个独立顾问,现居法国里昂。他主要从事Clojure培训与编码,参与了Clojure语言的开发,撰写过Enlive和 Moustache类库,也是Counterclockwise——Clojure IDE for Eclipse的贡献者,经常在clj-me.cgrand.net上发表有关Clojure的文章。 译者介绍: 徐明明,阿里巴巴资深软件开发工程师,热衷于研究开源技术及语言;目前网络浏览量最大的Clojure入门教程( http://xumingming.sinaapp.com/302/clojure-functional-programming-for-the-jvm-clojure-tutorial/)即译自其手;参与Twitter开源实时计算框架Storm的开发,是该项目的核心贡献者(该项目的主要语言就是Clojure), 同时也翻译了该项目的很多文档,推进了该项目在中国的应用。

AI 导读

核心看点
  • 系统讲解Clojure语法与函数式编程核心概念
  • 深入解析不可变数据结构与并发处理机制
  • 展示Clojure在JVM平台上的独特优势与实践
读者共识
  • 内容全面细致,是了解Clojure全貌的优质指南
  • 翻译质量总体较高,但部分术语表达略显生硬
  • 实践性强,但缺乏项目构建指导,需结合实战

精彩摘录

  • "Clojure的Special forms: Code Blocks: do 顺序执行并返回最后一个的值 e.g. let expressions provide an implicit do context to their bodies Defining Vars: def defn, defn-, defprotocol, defonce, defmacro deftype, defrecord, defmethod Local Bindings: let 可以理解为声明局部变量,但在FP里要称为‘名字绑定’ vs binding macro:which controls scoped "
  • "Michael Fogus and Chris Houser have inspired us in many ways large and small. One of the smaller ways was the style and presentation of the REPL interactions in their Clojure book, The Joy of Clojure, which we shamelessly copied and iterated."
  • "(instance? java.util.List al)"
  • "In the end, much of the challenge of programming is in identifying and holding tight to every invariant you can find, those things in your algorithms, applications, or business rules that do not change."
  • "(map ƒ [a b c] [x y z]) is equivalent to [(ƒ a x) (ƒ b y) (ƒ c z)]"
  • ">> from functools import partial >> only_strings = partial(filter, lambda x: isinstance(x, basestring)) >> only_strings(['a', 5, 'b', 6]) ['a', 'b']"
  • "we recommend that you become familiar with clojure.set. A namespace in Clojure’s standard library, clo jure.set provides a suite of functions implementing various higher-level operations and predicates over sets, including subset?, superset?, union, intersection, project, and more."
  • "The notion under consideration here is rooted in Okasaki’s Purely Functional Data Structures, where he describes techniques that allow the performance guarantees of immutable data structures to persist in later versions of those collections produced by various operations."

目录

第1章 进入Clojure仙境 1
为什么要选择Clojure? 1
获取Clojure 3
Clojure REPL 3
不!括号真的不会让你瞎了眼 6

显示全部

读者评论

很多概念没有介绍就突兀的出来了,要不是之前看过别的,根本不知道怎么回事。
看到宏,实在没精力了
不太适合想立即上手的人
不错的入门书籍
很努力的还是只看了大半。看着例子程序,勉强看得懂,但自己是绝对写不出来的。
Clojure的玩意儿老是把自己搞得跟邪教是的,上来先是恐吓,你之前的三观多不对,只有我是对的,然后跟其他语言比较,显示自己的与众不同,但绝口不提自己模仿的Scheme。“如果你使用的程序语言是这么工作的话,那就不要干了,辞职做木匠吧” 木匠怎么你了,你大爷的。
正在学习中
全部深度解读 →主题书单高分榜最近更新