Common Lisp 包含了操作樹的函數,不只是因爲我們需要樹這個結構,而是因爲我們需要一種方法,來操作列表及所有內部的列表。舉例來說,假設我們有一個這樣的列表: (and (integerp x) (zerop (mod x 2))) 而我們想要把各處的 x 都換成 y 。呼叫 substitute 是不行的,它只能替換序列 (sequence)中的元素: >...
一些常见的Lisp实现可能会选择将某些系统提供的数据类型(如bignum、readtables、streams、hash tables和pathnames)作为结构来实现,但是这个事实对于用户来说是不可见的。 Functions 函数是可以作为过程调用的对象;这些对象可以接受参数和返回值。(所有Lisp过程都可以解释为返回值,因此每个过程都是一个函数。)此类对象包括...
Common Lisp提供了一个真正的整数数据类型:任何整数,无论是正的还是负的,在原则上都有一个common Lisp数据对象的表示,只受总内存限制(而不是机器字宽)的限制。提供了一个真正的rational数据类型:两个整数的商(如果不是整数,则是一个比率)。还提供了各种范围和精度的浮点数以及笛卡尔复数。 Character 表示可打印的...
ANSI Common Lisp 中文版手册指南.pdf,ANSI Common Lisp 中文翻譯版 (Chinese Translation) 正體中文 简体中文 前言 前言 Chapter 1 簡介 (Introduction) Chapter 1 简介 (Introduction) Chapter 2 歡迎來到 Lisp (Welcome to Lisp) Chapter 2 欢迎来到 Lisp (Welcome to Li
3.3 爲什麼 Lisp 沒有指標 (Why Lisp Has No Pointers) 3.4 建立列表 (Building Lists) 3.5 範例:壓縮 (Example: Compression) 3.6 存取 (Access) 3.7 映射函數 (Mapping Functions) 3.8 樹 (Trees) 3.9 理解遞迴 (Understanding Recursion) 3.10 集合 (Sets) 3.11 序列 (Sequences) 3.12 棧 (Stacks) 3.13...
Thus, they may not be applicable to your Lisp compiler. The final topic, sequence functions, shows how to write efficient functions that work for either lists or vectors. 24.1 Packages A package is a symbol table that maps from strings to symbols named by those strings. When read is ...
The runtime library for Common Lisp is part of the standard. That makes it fully platform and vendor independent. The library is large and supplies several hundred highly flexible functions. These cover sequence and string utilities, sorting, hash table creation/lookup, flexible file I/O, numeric...
在这里predicate是函数EVENP,如果它的参数为偶数则返回true。#'标记的含义是“获取后面名称的函数”。如果没有#',Lisp会将evenp变量名并查找这个变量的值,而不会把evenp函数。 另外,也可以向REMOVE-IF-NOT函数传递匿名函数。比如,如果EVENP不存在,你可以将前面的表达式修改为:...
cl-oju - a few idioms, mostly relating to sequences, that I miss when writing Common Lisp. MIT. clj-con - Clojure-style concurrency operations in Common Lisp. MIT. clj-re - Clojure-style regular expression functions. clj-arrows - Clojure-compatible threading/transformation/arrow macros for ...
Common Lisp; in particular, a genericfunction can be used as an argument to funcall andapply and can be given a global or a local name.A method is an object that contains a method function, asequence of parameter speclalizers that specify when thegiven method is applicable, and a ...