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

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

bug#26540: 25.2; [PATCH] Add cl-set-equal to test for set equality


From: Drew Adams
Subject: bug#26540: 25.2; [PATCH] Add cl-set-equal to test for set equality
Date: Tue, 18 Apr 2017 07:00:52 -0700 (PDT)

> >> This patch adds cl-seq-equal to test whether two lists have the
> >> same elements. I.e., if every element of LIST1 also appears in
> >> LIST2 and if every element of LIST2 also appears in LIST1.
> >
> > Common Lisp (and the Emacs emulation) already has set
> > functions that do this - `[cl-]set-exclusive-or', for
> > example.
> 
> are you saying that (1) I should propose an implementation of
> set-equal based on set-exclusive-or (I guess it's just a `not`
> call away) or (2) not propose set-equal all together? I understand
> (1), but not the reasoning behind (2).

I'm just pointing out that a function we already have,
and one that is used more widely by users of Common
Lisp, does the same thing - unless I'm missing something.

If people think that some users might not think to use
`set-exclusive-or' to test set equality then we could
add a `set-equal' function.  Common Lisp didn't think
so, and neither do I, but I wouldn't oppose adding it.

If we do add it, I'd imagine that the implementation
should be the same (adding `not', as you say), for
clarity and consistency - unless other things are not
equal for some reason (i.e., unless there is a good
reason not to use the existing implementation).

In sum, I don't oppose adding it.  I'm just pointing
out that we already have it, in another form.





reply via email to

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