Property lists

What is a property list?

A property list is like an association list, but instead of each association being a pair, the associations are "written out" as alternating keys and values.

Assocition list: '((a . 1) (b . 2) (c . 3))

Property list: (a 1 b 2 c 3)

Symbol property lists

Traditionally some Lisp dialects can store a property list for each symbol in the Lisp system. The following Scheme implementations can do it:

Scheme Get property Put property Remove property Get p-list
Chicken get put or (setter get) remprop! symbol-plist
Chez Scheme getprop putprop remprop property-list (returns copy)
Ikarus getprop putprop remprop property-list (returns copy)
Larceny getprop putprop remprop (none)
Bigloo getprop putprop! remprop! symbol-plist
Guile symbol-property set-symbol-property! symbol-property-remove! (none)
Common Lisp get (setf (get key) val) remprop symbol-plist
Emacs Lisp get put cl-remprop symbol-plist

Chicken also provides:

Kawa's underlying implementation provides property lists for its Elisp implementation, but they aren't directly exposed to Scheme except through the Java FFI.

General-purpose property list functions

Common Lisp has functions that can manipulate any given plist, not only a symbol plist:


Back to Scheme Surveys

Page source (GitHub)