Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.
Next: Symbol Read Syntax, Previous: Symbol Primitives, Up: Symbols [Contents][Index]
In traditional Lisp dialects, symbols are often understood as having three kinds of value at once:
put
or get
functions.
Although Scheme (as one of its simplifications with respect to Lisp) does away with the distinction between variable and function namespaces, Guile currently retains some elements of the traditional structure in case they turn out to be useful when implementing translators for other languages, in particular Emacs Lisp.
Specifically, Guile symbols have two extra slots, one for a symbol’s property list, and one for its “function value.” The following procedures are provided to access these slots.
Return the contents of symbol’s function slot.
Set the contents of symbol’s function slot to value.
Return the property list currently associated with symbol.
Set symbol’s property list to value.
From sym’s property list, return the value for property
prop. The assumption is that sym’s property list is an
association list whose keys are distinguished from each other using
equal?
; prop should be one of the keys in that list. If
the property list has no entry for prop, symbol-property
returns #f
.
In sym’s property list, set the value for property prop to
val, or add a new entry for prop, with value val, if
none already exists. For the structure of the property list, see
symbol-property
.
From sym’s property list, remove the entry for property
prop, if there is one. For the structure of the property list,
see symbol-property
.
Support for these extra slots may be removed in a future release, and it is probably better to avoid using them. For a more modern and Schemely approach to properties, see Object Properties.
Next: Symbol Read Syntax, Previous: Symbol Primitives, Up: Symbols [Contents][Index]