From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Lists composed of equal number and kind of elements Date: Mon, 27 Jul 2015 16:52:34 -0700 Message-ID: References: <55B5D99B.9080100@easy-emacs.de> <87egjt41q9.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1438041193 3570 80.91.229.3 (27 Jul 2015 23:53:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jul 2015 23:53:13 +0000 (UTC) To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 28 01:53:08 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZJsCh-0008Uy-0a for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Jul 2015 01:53:07 +0200 Original-Received: from localhost ([::1]:56264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJsCg-0005fJ-3e for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Jul 2015 19:53:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJsCV-0005ey-HA for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 19:52:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJsCU-0001xJ-J4 for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 19:52:55 -0400 Original-Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:34427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJsCU-0001xF-ER for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 19:52:54 -0400 Original-Received: by obre1 with SMTP id e1so72013263obr.1 for ; Mon, 27 Jul 2015 16:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=VjxrTVfnMwuqs06/e+1ml/BeTKS46cuJRqEdjT6/nSM=; b=kqAvZzscPDr/Yqxtdq4K+M7Wk/MZOmOveYIgWKHUlM0nAsE7uu9g5qmx3jTgAglsPf NwFrYAKvPf9bTvqvol3DWhDJAVf3NDok4624rzpryL9NgZxzbK0G7GEJUWdrnOyEqd7V LBahGS6/1hlSZUo6VdYI1L3jf8C2UI4nv+IIXMzbUGHytVhGFrCoTkc61elrf1f210we TEavLSnuZRl3SodeiSH4x62xzJZ18CRxllIZtaSlOQfI5sqZ065sY2YtKEvb0U1IvLky B0X57d3uCqsUNUqxq+oaBLOH4tiaKdDAbNtlqlcWTu5NrMmBgN0OWzGOrP7u/6pJ0qX0 ciRA== X-Received: by 10.182.186.2 with SMTP id fg2mr32002923obc.35.1438041173852; Mon, 27 Jul 2015 16:52:53 -0700 (PDT) Original-Received: by 10.76.168.70 with HTTP; Mon, 27 Jul 2015 16:52:34 -0700 (PDT) In-Reply-To: <87egjt41q9.fsf@nl106-137-147.student.uu.se> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106043 Archived-At: > Anyway, to answer your question, try this: > > (defun set-equal (list-1 list-2) > (and (null (cl-set-exclusive-or list-1 list-2)) > (= (length list-1) > (length list-2)) )) > > Note: Depending what is deemed faster and/or more > likely to tell the correct state, the order of the > `and' arguments could be reversed... If `cl-set-exclusive-or' returns nil, aren't the two lists guaranteed to have the same length? -- john