Assuming the required width is bound to width , you can do this:
(format t "~{|~{ ~Vd~}|~%~}" width '((1 23 2 312) (23 456 1 7890)))
5 was replaced with V , and width was added as an argument to FORMAT /
edit: original answer incorrectly entered nested directives
In the format control string, V can be used instead of any constant value, indicating that the corresponding value should be taken from the argument list.
You can try the following:
(setf width 5) (setf data '((1 23 2 312) (23 456 1 7890))) (format t "~{|~{ ~{~Vd~}~}|~%~}" (mapcar #'(lambda (r) (mapcar
This format string requires that the desired width be preceding each value. An expression (mapcar ...) does this.
Wreach
source share