Hello,
Szymon <r5z-u28s_g1d@...> writes:
> I have not idea how to implement ARGLIST function in sbcl.
>
> Please help.
>
> (defun arglist (fn) ; from cvs: clocc/clocc/src/port/sys.lisp
> "Return the signature of the function."
> ;;
> ;; .....
> ;;
> #+sbcl
> (let ((f (coerce fn 'function)))
> (typecase f
> (STANDARD-GENERIC-FUNCTION (sb-pcl:generic-function-lambda-list f))
> (FUNCTION (sb-kernel:%simple-fun-arglist f)))))
(FUNCTION (sb-kernel:%simple-fun-arglist
(sb-kernel:%closure-fun f)))
Or
(require :sb-introspect)
(defun arglist (fn)
(sb-introspect:function-arglist fn))
--
Regards,
Alexey Dejneka
"Alas, the spheres of truth are less transparent than those of
illusion." -- L.E.J. Brouwer
|