> For the complete documentation index, see [llms.txt](https://emacs-lisp.ivory.cafe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emacs-lisp.ivory.cafe/xu-lie-shu-zu-he-xiang-liang/shu-zu-han-shu.md).

# 6.3 数组相关函数

本章将会介绍几个操作数组的函数，这些函数可以用在所有的数组类型上。

Function: arrayp object\
&#x20; 当 object 为数组时，该函数返回 t 。（数组包括向量、字符串、布尔向量以及字符表）

```
(arrayp [a])
    => t
(arrayp "asdf")
    => t
(arrayp (syntax-table))    ;; 字符表
    => t
```

Function: aref arr index\
&#x20; 这个函数返回 数组的第 index 个元素。其中，第一个元素对应的索引为0.

```
(setq primes [2 3 5 7 11 13])
    => [2 3 5 7 11 13]
(aref primes 4)
    => 11
(aref "abcdefg" 1)
    => 98         ; "b" 的ASCII码是98
```

类似的函数有 elt，不过是作用在序列上的，查阅序列章节。

Function: aset array index object\
TODO
