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

remprop


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

Syntax

(remprop symbol property)
symbol - the symbol with a property list
property - the property name being removed
returns - the property value

Description

The 'remprop' function removes the 'property' from the 'symbol'. The function returns a NIL. If the 'property' does not exist, there is no error generated. The 'symbol' must be an existing symbol. 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

(remprop person 'job)                ; remove JOB
(remprop person 'height)             ; remove non-existant

Common Lisp: Common Lisp does not have a 'remprop' function. It uses setf to achieve this functionality. Porting from Common Lisp to XLISP will work fine since XLISP supports the setf modifications of property lists and the get function to retrieve property values from symbol names. Porting from XLISP to Common LISP will require translating 'remprop' into setf forms.

See the remprop function in the XLISP 2.0 manual.

  Back to Top


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