Skip to content

Instantly share code, notes, and snippets.

@zhouqiang-cl
Created December 3, 2016 02:37
Show Gist options
  • Save zhouqiang-cl/3f8bc3998264c02c0e927ec977fb8e9f to your computer and use it in GitHub Desktop.
Save zhouqiang-cl/3f8bc3998264c02c0e927ec977fb8e9f to your computer and use it in GitHub Desktop.
common lisp 的访问器 ELT
语法
elt sequence index => object
(setf (elt sequence index) new-object)
参数和值
sequence --- 一个属性序列
index --- 属性序列的 index
object --- 一个 object
new-object --- 一个 object
描述
用 index 访问序列的元素
代码
* (eql str (copy-seq str))
NIL
* (setq str (copy-seq "0123456789"))
"0123456789"
* (elt str 6)
#\6
* (setf (elt str 0) #\#)
#\#
* str
"#123456789"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment