Repeat a string: Difference between revisions

Content added Content deleted
Line 363: Line 363:
result)</lang>
result)</lang>



For those who love conciseness and efficiency, even at the cost of readability:
For those who love one-liners, even at the expense of readability:
<lang lisp>(defun repeat-string (n string)
<lang lisp>(defun repeat-string (n string)
(format nil "~V@{~a~:*~}" n string))</lang>
(format nil "~V@{~a~:*~}" n string))</lang>