help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Lists composed of equal number and kind of elements


From: Drew Adams
Subject: RE: Lists composed of equal number and kind of elements
Date: Mon, 27 Jul 2015 18:07:43 -0700 (PDT)

>     (defun set-equal (list-1 list-2)
>       (and (null (cl-set-exclusive-or list-1 list-2))
>            (= (length list-1)
>               (length list-2)) ))

All you need to test is (cl-set-exclusive-or list-1 list-2).

(a a a b b), (b b a), and (b a) all represent the same set.

IOW, neither order nor duplication matters.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]