Olivier Galibert <galibert(a)pobox.com> writes:
So the problem is obvious (the list is commutative, equal
isn't),
but I don't know how to fix it (short of dropping the assert
entirely). Do we have an equal-commutative or something?
Sure -- remember that we have the power of cl.el's set functions at
our disposal. (And I see your callback is using them anyway.) Union
or intersection would do the trick, but I think it's more elegant to
use the `set-exclusive-or' function, possibly for the first time ever,
like this:
(assert (null (set-exclusive-or enabled-behavior-list val)))
For example:
(set-exclusive-or '(a b c) '(b a c))
=> nil
However:
(set-exclusive-or '(a b x c) '(b a c y))
=> (x y)