El martes, 10 de abril de 2012 03:22:01 UTC+2, WJ escribió:
> > > Is there a portable way to calculate a function's arity in CL? I've
> > > skimmed the CLtL2 book without success. I suppose it can't be done
> > > because a function can take optional arguments... I'm I missing
> > > something obvious?
Yes :
(defun cube (x) (* x x x)) -> cube
(second (function-lambda-expression (function cube))) -> (x)
(length (second (function-lambda-expression (function cube)))) -> 1