pushnew/incf-acons |
| item increment place
&key key test test-not | [Macro] |
Purpose
Increment by increment the value associated with
item in an association list stored in place or add a
new (item . increment)
Package :gbbopen-tools
Module :gbbopen-tools
Arguments and values
item | An object | |
increment | A number | |
place | A form which is suitable for use as a generalized reference | |
key | A function designator specifying a function object
of one argument, or nil (default is nil )
| |
test | A function designator specifying a function object
of two arguments that returns a generalized boolean (default is
#'eql | |
test-not | A function designator specifying a
function object of two arguments that returns a
generalized boolean (use of :test-not | |
new-place-value | An association list |
Returns
An association list (the new value of place).
See also
push-acons
pushnew-acons
decf/delete-acons
Examples
> (setf alist nil) nil > (pushnew/incf-acons 'x 1 alist) ((x . 1)) > (pushnew/incf-acons 'x 1 alist) ((x . 2)) > (pushnew/incf-acons 'y 2 alist) ((y . 2) (x . 2)) > (pushnew/incf-acons 'x -1 alist) ((y . 2) (x . 1)) > alist ((y . 2) (x . 1)) >
Note
Declared numeric and pseudo
probability versions of
The GBBopen Project
pushnew/incf-acons |