Lisp format a character a number of times

后端 未结 4 1051
天命终不由人
天命终不由人 2020-12-01 21:08

I am looking for a way to output a character a number of times using format. Is this possible? Can someone fill in the _?_\'s, so that the example works?

<
4条回答
  •  感动是毒
    2020-12-01 21:49

    It's nice to see so many solutions: ~A, ~<, and ~{ so far.

    The ~@{ iteration construct provides a concise solution:

    (format nil "~v@{~A~:*~}" 3 #\*)
    

提交回复
热议问题