This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
符号是变量的名字,符号本身就是以对象的方式存在 | |
符号必须要被引用,不然会被当作变量 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
probe-file pathspec => truename | |
参数和值 | |
pathspec --- 路径指示符 | |
truename --- 真实路径或者 nil | |
描述 | |
probe-file 测试 pathspec 是否存在, 如果这个路径不存在, 则返回 nil. | |
反之返回 pathspec 的真实路径 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
gensym &optional x => new-symbol | |
参数和值 | |
x --- 一个 string 或者一个 number | |
new-symbol --- 一个新的全局 symbol | |
描述 | |
产生一个新的符号 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
block name form* => result* | |
变量和值 | |
name --- 一个符号 | |
form --- 一个form | |
results --- 如果正常的返回, 则是 form 的返回. 如果一个显示的 return 触发. 那就是 return 的 value. | |
描述 | |
block 创建一个名字为 name 的区块, 并且对 forms 进行. block 像是一个带紧急出口的 progn. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
with-open-file (stream filespec options*) declaration* form* => results | |
参数和值 | |
stream --- 一个变量 | |
filespec --- 一个文件指示符 | |
options --- 一个form, 会被求值 | |
results --- forms的值 | |
描述 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
概念 | |
hash table 能给一个指定的 key 关联一个值, 如果尝试给这个 key 关联第二个值, 第二个值会覆盖第一次的值 | |
类别 | |
hash table 有四种类别 | |
1. key 用 eq 比较 | |
2. key 用 eql 比较 | |
3. key 用 equal 比较 | |
4. key 用 equalp 比较 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
make-hash-table &key test size rehash-size rehash-threshold => hash-table | |
参数和值 | |
test --- 一个指示符. eq, eql, equal, equalp 函数中的一个, 默认是eql | |
size --- 一个正整数 | |
rehash-size --- 一个正整数或者浮点数 | |
rehash-threshold --- 0-1 之间的一个实数 | |
hash-table --- 一个 hash table 对象 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
hash-table-count hash-table => count | |
参数和值 | |
hash-table --- 一个 hash table | |
count --- 一个正整数 | |
描述 | |
返回 hash-table 的大小, 如果hash-table 刚刚被创建, 那 count 为0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
hash-table-size hash-table => size | |
参数和值 | |
hash-table --- 一个hash table | |
size --- 一个正整数 | |
描述 | |
返回 hash-table 的 size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
gethash key hash-table &optional default => value, present-p | |
(setf (gethash key hash-table &optional default) new-value) | |
参数和值 | |
key --- 一个对象 | |
hash-table --- 一个 hash table | |
描述 | |
获取 key 的值和设置key的值 |