You are looking at historical revision 34261 of this page. It may differ significantly from its current revision.

Module (chicken plist)

As in other Lisp dialects, CHICKEN supports "property lists" associated with symbols. Properties are accessible via a key that can be any kind of value but which will be compared using eq?.

get

[procedure] (get SYMBOL PROPERTY [DEFAULT])

Returns the value stored under the key PROPERTY in the property list of SYMBOL. If no such property is stored, returns DEFAULT. The DEFAULT is optional and defaults to #f.

put!

[procedure] (put! SYMBOL PROPERTY VALUE)
[procedure] (set! (get SYMBOL PROPERTY) VALUE)

Stores VALUE under the key PROPERTY in the property list of SYMBOL replacing any previously stored value.

remprop!

[procedure] (remprop! SYMBOL PROPERTY)

Deletes the first property matching the key PROPERTY in the property list of SYMBOL. Returns #t when a deletion performed, and #f otherwise.

symbol-plist

[procedure] (symbol-plist SYMBOL)
[procedure] (set! (symbol-plist SYMBOL) LST)

Returns the property list of SYMBOL or sets it. The property list is a flat list of alternating properties and values.

This list is not guaranteed to be a fresh copy, so avoid mutating it directly.

get-properties

[procedure] (get-properties SYMBOL PROPERTIES)

Searches the property list of SYMBOL for the first property with a key in the list PROPERTIES. Returns 3 values: the matching property key, value, and the tail of property list after the matching property. When no match found all values are #f.

This tail of the property list is not guaranteed to be a fresh copy, so avoid mutating it directly.

PROPERTIES may also be an atom, in which case it is treated as a list of one element.


Previous: Module (chicken platform)

Next: Module (chicken port)