replicate is a function that takes an integer and a sequence and returns the sequence repeated n times.
E.g. replicate 3 ["a"]
returns ["a", "a", "a"]
Does Common Lisp have an equivalent function, or do I have to write one?
Use make-list
(make-list 3 :initial-element 'a)
It evaluates to
(A A A)
(make-sequence 'list n :initial-element element)
HyperSpec
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With