&key
key test test-not → generalized-booleansubsetp returns true if every element of list-1 matches some element of list-2, and false otherwise.
Whether a list element is the same as another list element is determined by the functions specified by the keyword arguments. The first argument to the :test
or :test-not
function is typically part of an element of list-1 extracted by the :key
function; the second argument is typically part of an element of list-2 extracted by the :key
function.
The argument to the :key
function is an element of either list-1 or list-2; the return value is part of the element of the supplied list element. If :key
is not supplied or nil, the list-1 or list-2 element itself is supplied to the :test
or :test-not
function.
(defparameter *cosmos* '(1 "a" (1 2)))
→*COSMOS*
(subsetp '(1) *cosmos*)
→(subsetp '((1 2)) *cosmos*) → false (subsetp '((1 2)) *cosmos* :test #'equal)
→(subsetp '(1 "A") *cosmos* :test #'equalp)
→(subsetp '((1) (2)) '((1) (2)))
→(subsetp '((1) (2)) '((1) (2)) :key #'car)
→
None.
None.
Should be prepared to signal an error of type type-error if list-1 and list-2 are not proper lists.
{\secref\TraversalRules}
To be done.
The :test-not
parameter is deprecated.
\issue{MAPPING-DESTRUCTIVE-INTERACTION:EXPLICITLY-VAGUE} \issue{TEST-NOT-IF-NOT:FLUSH-ALL}