> 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/fu-hao/9.4-fu-hao-shu-xing/9.4.1-du-qu-fu-hao-shu-xing-done.md).

# 9.4.1 存取符号属性（DONE）

下面的函数被用来存取符号属性。

**Function: get&#x20;*****symbol property***\
&#x20; 该函数返回 symbol 中属性列表中名称为 property 的属性。如果没有这个属性，则会返回 nil。因此，拥有一个值为 nil 的属性 和 没有这个属性是等价的。\
&#x20; 参数 property 会与已存在的 property 使用 eq 比较，因此，任何对象都是合理的属性。 &#x20;

请查看 put 的例子。

**Function: put&#x20;*****symbol property value***\
&#x20; 这个函数及将 value 放入 符号 symbol 的属性列表中，这个操作会覆盖之前已有的属性值。这个函数会返回 value 作为求值结果。

```
(put 'fly 'verb 'transitive)
    => 'transitive
(put 'fly 'noun '(a buzzing little bug))
    => (a buzzing little bug)
(get 'fly 'verb)
    => transitive
(symbol-plist 'fly)
    => (verb transitive noun (a buzzing little bug))
```

**Function: symbol-plist&#x20;*****symbol***\
&#x20; 这个函数返回符号的属性列表。

**Function: setplist symbol&#x20;*****plist***\
&#x20; 这个函数将将 symbol 的属性列表设置为 plist。\
&#x20; 通常情况下，plist 应该是结构良好的属性列表，不过这并不是强制的。这个函数求值结果为 plist

```
(setplist 'foo '(a 1 b (2 3) c nil))
    => (a 1 b (2 3) c nil)
(symbol-plist 'foo)
    => (a 1 b (2 3) c nil)
```

&#x20; 在特殊 obarray 中的非常规符号，使用不规范的属性列表有时是很有用的。比如，缩写机制就利用了这个想法。 &#x20;

你可以使用 setplist 和 plist-put 来定义 put 函数。比如：

```
(defun put (symbol prop value)
  (setplist symbol
            (plist-put (symbol-plist symbol) prop value)))
```

**Function: function-get&#x20;*****symbol proerty \&optional autoload***\
&#x20; 这个函数和 get 十分相似，不同的地方在于，若 symbol 是某个函数的别名，它会检索别名指代的真正的符号的属性列表。详情查阅 函数定义 章节。如果可选参数 autoload 是non-nil 值，而 symbol 是 auto-loaded。那这个函数会尝试自动加载，而自动加载可能会导致该符号属性列表的重新设置。如果 autoload 参数是符号macro，那么当且符号是自动加载宏的时候才会尝试自动加载。

**Function: function-put&#x20;*****function property value***\
&#x20; 这个函数设置 function 的 property 为 value。参数 function 应该为一个 符号。这个函数倾向于调用 put 函数来为 function 设置属性，这样会很方便我们后续实现从旧属性到新属性的重映射。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://emacs-lisp.ivory.cafe/fu-hao/9.4-fu-hao-shu-xing/9.4.1-du-qu-fu-hao-shu-xing-done.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
