Next: , Previous: , Up: Symbols   [Contents][Index]


5.6.2 Symbol Attributes

All symbols have two basic attributes: print name and property list. Most important is the print name of the symbol. This is a string naming the symbol, after it has been defined (when the symbol is first created) it may not be changed.

Function: symbol-name symbol

This function returns the print name of the symbol symbol.

(symbol-name 'unwind-protect)
    ⇒ "unwind-protect"

The symbol’s property list (or plist) is similar to an alist (see Association Lists), though stored differently, and provides a method of storing arbitrary extra values in each symbol. See Property Lists.

Although not strictly an attribute of the symbol, symbols also provide a means of associating values with names (i.e. variables). Within a defined context, a symbol may have a binding, this binding associates the symbol with a memory location within which a value may be stored. When writing Lisp programs, the value of a symbol’s current binding is accessed by writing the print name of the symbol. Similarly the binding may be modified by using the setq special form. See Variables.