摘要: 今年年初开始接触Common Lisp(以下都简称Lisp), 原因就是看了Paul Graham的《黑客与画家》(又被鼓动了, 哈哈). Paul在这本书中强烈推荐程序员学习Lisp, 宣称通过学习这门语言能给程序员带来不小的帮助. 具体的内容大家可以花点时间自行阅读一下, 书的内容还是很不错的. 书中写的不仅仅是关于计算机的知识, 还有一些关于财富的看法、教育的看法等等一系列有意思的观点, 挺不错的书. 出于自己的好奇心, 于是打算开始用空余的时间学习一下Lisp. 于是在amazon上花了不少钱买了一本Paul的《ANSI Common Lisp》来看. 买实体书倒不是因为自身条件有多宽 阅读全文
posted @ 2013-09-05 11:17 neo_shen 阅读(1171) 评论(0) 推荐(0)
摘要: incf and decf> (setq x 5)> (incf x 3) ;; ==> 8 (equivalent to (setq x (+ x 3))> (incf x) ;; ==> 9 (equivalent to (setq x (1+ x))> (decf x 7) ;; ==> 2 (equivalent to (setq x (- x 7)) > (decf x) ;; ==> 1 (equivalent to (setq x (1- x))setf and setqSETF is a macro which uses S 阅读全文
posted @ 2013-05-08 11:35 neo_shen 阅读(823) 评论(0) 推荐(0)
摘要: (eq x y) is true if and only if x and y are the same identical object.The eql predicate is true if its arguments are eq, or if they are numbers of the same type with the same value, or if they are character objects that represent the same character.The equal predicate is true if its arguments are st 阅读全文
posted @ 2013-05-06 18:30 neo_shen 阅读(614) 评论(0) 推荐(0)
摘要: 1 ;;ASSOC function searches supplied list for cons cell that have item as car part. Return value is the cell with key-value pair which key matched testing conditions, otherwise NIL. Default comparison operator is EQL. 2 3 ;;Associative list, or for short alist, is a list with key-value pairs in co.. 阅读全文
posted @ 2013-05-06 13:59 neo_shen 阅读(892) 评论(0) 推荐(0)
摘要: 1 ;; This is a typical usage, for pulling apart a list 2 (destructuring-bind 3 (first second) 4 '(1 2) 5 (format t "~%~%;;; => first:~a second:~a~&" first second)) 6 ;;; > first:1 second:2 7 8 ;; You can also pull apart improper lists: 9 (destructuring-bind10 (first . second) 阅读全文
posted @ 2013-05-05 03:21 neo_shen 阅读(421) 评论(0) 推荐(0)