Previous: , Up: Property Lists   [Contents][Index]


11.9.3 Converting Plists To/From Alists

Function: alist-to-plist alist

This function converts association list alist into the equivalent property-list form. The plist is returned. This converts from

((a . 1) (b . 2) (c . 3))

into

(a 1 b 2 c 3)

The original alist is not modified.

Function: plist-to-alist plist

This function converts property list plist into the equivalent association-list form. The alist is returned. This converts from

(a 1 b 2 c 3)

into

((a . 1) (b . 2) (c . 3))

The original plist is not modified.

The following two functions are equivalent to the preceding two except that they destructively modify their arguments, using cons cells from the original list to form the new list rather than allocating new cons cells.

Function: destructive-alist-to-plist alist

This function destructively converts association list alist into the equivalent property-list form. The plist is returned.

Function: destructive-plist-to-alist plist

This function destructively converts property list plist into the equivalent association-list form. The alist is returned.