Re: programmatically determine if argument is list compatible to a given lambda list



even after getting rid of the lexical binding problem, i'd like to
tell sbcl that i'm not interesting in
seeing the other comments. any ideas?



(defun callable-as (arg-list lambda-list)
(declare (sb-ext:muffle-conditions sb-ext:compiler-note))
(handler-case (apply (coerce `(lambda ,lambda-list
t)
'function)
arg-list)
(program-error () nil)))

TYPE> (callable-as '(3) '(x))
; #'(LAMBDA (TYPE::X) T)
;
; caught STYLE-WARNING:
; The variable X is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
T
TYPE>

.