The 'get-lambda-expression' function takes the 'closure' object and returns a reconstruction of a lambda or macro expression that defines the 'closure'. The parameter must be a 'closure' expression.
(defun mine (a b) (print (+ a b))) ; define MINE defun (get-lambda-expression (function mine)) ; returns (LAMBDA (A B) (PRINT (+ A B))) (get-lambda-expression (lambda (a) (print a)) ; returns (LAMBDA (A) (PRINT A)) (defmacro plus (n1 n2) `(+ ,n1 ,n2)) ; define PLUS macro (get-lambda-expression (function plus)) ; returns (MACRO (N1 N2) (BACKQUOTE (+ (COMMA N1) (COMMA N2))))
See the
get-lambda-expression
function in the