Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

set

set

type: function (subr) 
location: built-in
source file: xlbfun.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(set <symbol> <expr> )
        <symbol>        -       expression that evaluates to a symbol name
                                (if expression is quoted, no evaluation occurs)
        <expr>          -       an expression - which will be the new value

DESCRIPTION

SET evaluates <symbol> and sets <expr> as it's value. If the <symbol> value is quoted (via the QUOTE special form or read-macro expansion), the <symbol> is not evaluated. SET returns the value from <expr> as it's result.

EXAMPLES

(set 'a 2)                              ; sets symbol A to value 2
(set 'value a)                          ; sets symbol VALUE to value 2
(print value)                           ; show the value - prints 2
(set 'name 'myvar)                      ; set symbol NAME to value MYVAR
(set name 12345)                        ; set symbol which is the value
                                        ;     of NAME (MYVAR) to 12345
(print name)                            ; prints MYVAR  
(print myvar)                           ; prints 12345
                                        ;
(set notsymbol 1)                       ; error: unbound variable
(set name notvalue)                     ; error: unbound variable


Go to the first, previous, next, last section, table of contents.