Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
replicate是一个函数,它接受一个整数和一个序列并返回重复 n 次的序列。
例如replicate 3 ["a"]退货["a", "a", "a"]
replicate 3 ["a"]
["a", "a", "a"]
Common Lisp 是否具有等效功能,还是我必须编写一个?
使用制作清单
(make-list 3 :initial-element 'a)
它评估为
(A A A)
(make-sequence 'list n :initial-element element)
HyperSpec