remove-propertyGBBopen Toolssets-overlap-pset-equalGoTo Top

set-equal   list-1 list-2 &key test test-not key => boolean[Function]

Purpose
Determine if all elements in two lists are present in both lists.

Package   :gbbopen-tools

Module   :gbbopen-tools

Arguments and values

list-1     A proper list
list-2     A proper list
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 is deprecated)
key     A function designator specifying a function object of one argument, or nil (default is nil)
boolean     A generalized boolean

Returns
True if all elements in list-1 are also in list-2 and vice versa; nil otherwise.

Description
Duplicate elements in either list are permitted, so the lengths of list-1 and list-2 can differ and still return true.

Examples

  > (set-equal '(1 2 3) '(3 2 1))
  t
  > (set-equal '(1 2) '(3 2 1))
  nil
  > (set-equal '(1 2 3) '(3 1))
  nil
  > (set-equal '(1 2 3) '(3 3 3 2 1))
  t
  > (set-equal '(1 2 3) '(4 5 6 7) :test #'/=)
  t
  >


The GBBopen Project


remove-propertyGBBopen Toolssets-overlap-pset-equalGoTo Top