Code: Select all
(eval-when (&any :compile-toplevel :load-toplevel :execute) &body body)
Hope I'm not starting to monopolize this forum with my questions - feel free to ask me to dial down the verbosity.
Code: Select all
(eval-when (&any :compile-toplevel :load-toplevel :execute) &body body)
Code: Select all
(defun foo (&any bar baz) nil)
=> STYLE-WARNING: suspicious variable in lambda list: &ANY
Reading "slime/contrib/swank-arglists.lisp" it turns out that the &ANY hint is produced by specialized methods of the swank:arglist-dispatch function, so the only way to get your own &ANY hint would be to write your own swank:arglist-dispatch method.garethw wrote:I have need to write a macro with a number of optional keywords I'd like to support ... it certainly wouldn't be hinted like this.
Code: Select all
(defmethod arglist-dispatch ((operator (eql 'eval-when)) arguments)
(declare (ignore arguments))
(let ((eval-when-args '(:compile-toplevel :load-toplevel :execute)))
(make-arglist
:required-args (list (make-arglist :any-p t :any-args eval-when-args))
:rest '#:body :body-p t)))