Although that gives a different error, (defun foo (f x) (let ((l (if x (list (mapcar #'car x)) (list (list x))))) (declare (dynamic-extent l)) (funcall f l)))
but they are probably caused by the same thing.
Although that gives a different error,
(list (mapcar #'car x))
(list (list x)))))
(defun foo (f x)
(let ((l (if x
(declare (dynamic-extent l))
(funcall f l)))
but they are probably caused by the same thing.