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: Emanuel Berg
Subject: Re: Lists composed of equal number and kind of elements
Date: Tue, 28 Jul 2015 01:56:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

John Mastro <john.b.mastro@gmail.com> writes:

>> 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?

No: (cl-set-exclusive-or '(1) '(1 1)) ; nil

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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