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?
(format nil "~a~:*~a~:*~a~:*" #\*)
"***"
Or elaborating a bit on Joshua Taylor's answer:
(format nil "~v{~a~:*~}" 3 '(#\*))
Would be one way of doing this. Don't be confused by the asterisks in the format directive, they are control characters, not characters being printed.
In terms of efficiency, however, this:
(make-string 3 :initial-element #\*)
would be a preferred way to achieve the same effect.