I want to do this
(format nil "One occurence of ~X , another one: ~X , and yet another one: ~X" #\some-char)
Is there any X format directive that can do this?
Found it: It is ~:*
It tells lisp to reuse the last argument. Like rewinding the arguments one place back.
For the whole explanation paragraph see: http://www.gigamonkeys.com/book/a-few-format-recipes.html (it is near the bottom of the page)
So it becomes
(format nil "One occurence of ~C , another one: ~:*~C , and yet another one: ~:*~C" #\a)
=> "One occurence of a , another one: a , and yet another one: a"
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