Created
December 3, 2016 02:37
-
-
Save zhouqiang-cl/3f8bc3998264c02c0e927ec977fb8e9f to your computer and use it in GitHub Desktop.
common lisp 的访问器 ELT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
语法 | |
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