A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw71/LW/html/lw-1327.htm below:

cdr-assoc

Description

The accessor cdr-assoc provides a generalized reference for elements in an association list. The arguments are all as specified for the Common Lisp function assoc. cdr-assoc and its setf expander read and write the cdr of an element in a manner consistent with the Common Lisp notion of places.

cdr-assoc returns the cdr of the first cons in the alist alist that matches item (tested using test, test-not and key as for assoc), or nil if no element of alist matches.

Using cdr-assoc with setf modifies the first cons in the value of place that matches item, setting its cdr to value. If no element matches, then it pushes the value of (cons item value) onto the value of place and sets place to this new alist. This is similar to how cl:getf is defined.

When place is a globally accessible place that may be read by another thread without synchronization (by a lock or other synchronization mechanism), you need to wrap alist by globally-accessible. See Making an object's contents accessible to other threads for a discussion.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4