emacs - Emacs 中 sexp 和 list 的区别?

标签 emacs elisp delimiter parentheses s-expression

在 Emacs 中,有一些命令可以在括号(或任何方括号)分隔的表达式之间移动光标,即前向性指数、后向性指数、前向列表和后向列表。在 Lisp 和任何其他代码中,它们的行为类似,所以我认为 *-sexp 和 *-list 之间没有区别,除了最后一个在注释或引号内不起作用。

sexp 和 list 命令之间的功能区别是什么,什么时候应该使用哪个?

以防万一,我理解 up-list 和 down-list 命令,它们与主题无关。

最佳答案

列表是 s 表达式的一个示例,因此任何对 s 表达式进行操作的函数都应该适用于列表(但不一定反之亦然,因为也存在非列表 sexp)。

elisp手册说:

A Lisp object that is intended for evaluation is called a "form" or "expression"(1). The fact that forms are data objects and not merely text is one of the fundamental differences between Lisp-like languages and typical programming languages. Any object can be evaluated, but in practice only numbers, symbols, lists and strings are evaluated very often.

---------- Footnotes ----------

(1) It is sometimes also referred to as an "S-expression" or "sexp", but we generally do not use this terminology in this manual.

C-hig (elisp) 简介评估 RET

关于emacs - Emacs 中 sexp 和 list 的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10967850/

相关文章:

emacs - 在 LispBox 中的 Emacs 中加载 SLIME 编辑命令

emacs - 在 Elisp 中,如何正确插入带有斜杠的路径字符串?

java - 分隔符在省略整数时会给出多余的空间

linux - Unix AWK 命令 - 多个字符作为单个分隔符

python - Win7 上的 emacs 配置文件在哪里?

linux - 如何在 Emacs lisp/config 中使用 unix 登录用户名?

emacs - Emacs 中 LaTeX 的代码折叠

emacs - 如何轻松重复 emacs find-grep

vim - Emacs 相当于 Vim 的 foldmethod = indent