I'm trying to work out a way of providing mutliple arguments to a function, where the arguments are held in a variable as a list. I've got a stripped down example of what I'm trying to do:
Code: Select all
(defun print-record (format-str &rest args)
(format t format-str args))
(print-record "~A ~A~%" 'first-arg 'second-arg)
The format string doesn't expect a list for its arguments, so this fails. I was hoping that 'multiple-value-call' might work, but it keeps list arguments as lists too

e.g.:
Code: Select all
(multiple-value-call #'format (values t format-str args))
(yes, I know that 'format' can iterate over a list to print multiple records, but that isn't what I want here).
Is there any way to do this with CL ?
Cheers,
Chris