Is there a way to avoid duplicating the 1 in the following line using cl-format?
(cl-format true "line~p: ~d\n" 1 1)
CL-USER> (format t "line~p: ~:*~d~%" 1)
line: 1
NIL
CL-USER> (format t "line~p: ~:*~d~%" 2)
lines: 2
NIL
(There's also ~n@* to go to the nth argument.)
22.3.7.1 Tilde Asterisk: Go-To
The next arg is ignored. ~n* ignores the next n arguments.
~:* backs up in the list of arguments so that the argument last processed will be processed again. ~n:* backs up n arguments.
[…] ~n@* goes to the nth arg, where 0 means the first one; n defaults to 0, so ~@* goes back to the first arg. Directives after a ~n@* will take arguments in sequence beginning with the one gone to.
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