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

eval


Type:   -   function (subr)
Source:   -   xlbfun.c, xleval.c

Syntax

(eval expression)
expression - an arbitrary expression
returns - the result of evaluating the expression

Description

The 'eval' function evaluates the 'expression' and returns the resulting value.

Examples

(eval '(+ 2 2))            ; returns 4
(eval (cons '+ '(2 2 2)))  ; returns 6
(eval (list '+ '2 '3 ))    ; returns 5

(setq a 10)                ; set up A with value 10
(setq b 220)               ; set up B with value 220

(eval (list '+ a b ))      ; returns 230 because
                           ;   (list '+ a b) => '(+ 10 220)

(eval (list '+ 'a b))      ; returns 230 because
                           ;   (list '+ 'a b) => '(+ A 220)
                           ;   and A has the value 10

See the eval function in the XLISP 2.0 manual.

  Back to Top


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