XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

get-lambda-expression


Type:   -   function (subr)
Source:   -   xlcont.c

Syntax

(get-lambda-expression closure)
closure - a closure object from a previously defined function or macro
returns - the original lambda expression

Description

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.

Examples

(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 XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next