Hi all,

Consider the following:
(defun fun (&key arg)
   (declare (ignore arg))
   nil)
(defun (setf fun) (value &key arg)
   (declare (ignore arg value))
   nil)
(push 'a (fun :arg 'bla))

This gives the following note when executing this:
; Note: The first argument (in keyword position) is not a constant.

If I check the macroexpansion of the last form, I can see where it
comes from:
(macroexpand-1 '(push 'a (fun :arg 'bla)))
(LET* ((#:G2520 'A)
       (#:G2519 :ARG)
       (#:G2518 'BLA)
       (#:G2517 (CONS #:G2520 (FUN #:G2519 #:G2518))))
  (FUNCALL #'(SETF FUN) #:G2517 #:G2519 #:G2518))
T

It evaluates ':arg' to make sure it gets evaluated only once, but then
the keyword argument to (setf fun) is no longer a constant.

Is there any way to get rid of the note?
Am I doing something else wrong?

Thanks,

Kris


Reply via email to