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

quote


Type:   -   special form (fsubr)
Source:   -   xlcont.c

Syntax

(quote expr)
expr - an expression
returns - the unevaluated expression

Description

The 'quote' function returns the 'expr' unevaluated.

Examples

my-var                    ; error: unbound variable
(quote my-var)            ; returns MY-VAR
my-var                    ; still error: unbound variable
(set (quote my-var) 111)  ; give MY-VAR a value, make it exist
my-var                    ; returns 111
(quote my-var)            ; returns MY-VAR

;; Same as above but using the ' read macro for quote

new-var                   ; error: unbound variable
'new-var                  ; returns NEW-VAR
new-var                   ; still error: unbound variable
(setq new-var 222)        ; give NEW-VAR a value, make it exist
new-var                   ; returns 222
'new-var                  ; returns NEW-VAR

Read macro: XLISP supports the read macro of a single quote as a short-hand method of writing the 'quote' function.

See the quote special form in the XLISP 2.0 manual.

  Back to Top


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