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.

get

get

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

SYNTAX

(get <symbol> <property> )
        <symbol>        -       the symbol with a property list
        <property>      -       the property name being retrieved

DESCRIPTION

GET returns the value of the <property> from the <symbol>. If the <property> does not exist, a NIL is returned. The <symbol> must be an existing symbol. The returned value may be a single value or a list.

Property lists are lists attached to any user defined variables. The lists are in the form of (name1 val1 name2 val2 ....). Any number of properties may be attached to a single variable.

EXAMPLES

(setq person 'bobby)                    ; create a var with a value
(putprop person 'boogie 'last-name)     ; add a LAST-NAME property
(putprop person 'disc-jockey 'job)      ; add a JOB property
(get person 'last-name)                 ; retrieve LAST-NAME - boogie
(get person 'job)                       ; retrieve JOB - disc-jockey
(get person 'height)                    ; non-existant - returns NIL
(putprop person '(10 20 30) 'stats)     ; add STATS - a list 
(get person 'stats)                     ;

NOTE: You can set a property to the value NIL. However, this NIL value is indistinguishable from the NIL returned when a property does not exist.

COMMON LISP COMPATIBILITY: Common LISP allows for an optional default value, which XLISP does not support.


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