Clamps Dictionary
get-duplicates
Function
(get-duplicates list &key (test #'eql) (once nil))
Return all Elements of list which occur more than once with respect to the test predicate. If once is non-nil, return each duplicate element only once.
Arguments
list |
List being examined. |
test |
Function to determine equality of elements. |
once |
Boolean to determine if only one of the duplicate elements is returned. |
Examples
(get-duplicates '(0 1 3 2 4 3 9 3 1 3 4 2 3)) ; => (1 3 2 4 3 3 3) (get-duplicates '(0 1 3 2 4 3 9 3 1 3 4 2 3) :once t) ; => (1 2 4 3)
Created: 2025-02-18 Di 12:58