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

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Mon, 17 Apr 2017 09:17:01 UTC

Severity: wishlist

Tags: patch

Found in version 25.2

Done: Nicolas Petton <nicolas <at> petton.fr>

Bug is archived. No further changes may be made.

Full log


Message #38 received at 26540 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Petton <nicolas <at> petton.fr>
To: Damien Cassou <damien <at> cassou.me>, John Mastro <john.b.mastro <at> gmail.com>,
 26540 <at> debbugs.gnu.org
Subject: Re: bug#26540: 25.2; [PATCH] Add cl-set-equal to test for set equality
Date: Wed, 19 Apr 2017 16:41:17 +0200
[Message part 1 (text/plain, inline)]
Damien Cassou <damien <at> cassou.me> writes:

> +(cl-defgeneric seq-set-equal (sequence1 sequence2 &optional testfn)
                  ^^^^^^^^^^^^^
                  What about `seq-set-equal-p'?

> +  "Return true if SEQUENCE1 and SEQUENCE2 have same elements.
             ^^^^
             We say non-nil
             
> +I.e., if every element of SEQUENCE1 also appears in SEQUENCE2 and if
> +every element of SEQUENCE2 also appears in SEQUENCE1.

What do you think about the following instead?

  Return non-nil if SEQUENCE1 and SEQUENCE2 contain the same elements,
  regardless of the order.

> diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
> index 788524b..9cc54d8 100644
> --- a/test/lisp/emacs-lisp/seq-tests.el
> +++ b/test/lisp/emacs-lisp/seq-tests.el

All your contributions are very well tested, thank you always taking the
effort to add unit tests! :-)

Cheers,
Nico
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 8 years and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.