「Emacs Lisp」- 常用函数(学习笔记)

  CREATED BY JENKINSBOT

car、cdr

https://www.gnu.org/software/emacs/manual/html_node/eintr/car-_0026-cdr.html#car-_0026-cdr%20

car:返回列表的第一个元素:(car ‘(rose violet daisy buttercup)) => rose

cdr:返回列表的第一个元素后面的元素:(cdr ‘(rose violet daisy buttercup)) => (violet daisy buttercup)

cons

https://www.gnu.org/software/emacs/manual/html_node/eintr/cons.html#cons%20

cons:构建列表:(cons ‘pine ‘(fir oak maple)) => (pine fir oak maple)

dolist

https://www.gnu.org/software/emacs/manual/html_node/eintr/dolist.html%20

(dolist (element list) body…):循环地将 list 的首个元素赋值到 element,并移除该首个元素