8.4 其他哈希表函数

以下是一些用于操作哈希表的其他函数。

Function: hash-table-p table

table 是哈希表对象,则返回非 nil 值。

Function: copy-hash-table table

该函数创建并返回 table 的一个副本。仅哈希表本身会被复制 — 键和值均为共享引用。

Function: hash-table-count table

该函数返回 table 中实际存在的条目数量。

Function: hash-table-test table

该函数返回创建 table 时指定的 test 参数值(该参数用于定义哈希计算和键比较的方式)。参见 make-hash-table(see 创建哈希表)。

Function: hash-table-weakness table

该函数返回为哈希表 table 指定的 weak 参数值(弱引用属性)。

Function: hash-table-size table

该函数返回 table 当前的内存分配大小。由于哈希表的内存分配是自动管理的,该值通常无需关注。

emacs

Emacs

org-mode

Orgmode

Donations

打赏

Copyright

© 2025 Jasper Hsu

Creative Commons

Creative Commons

Attribute

Attribute

Noncommercial

Noncommercial

Share Alike

Share Alike