From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Sat, 11 Nov 2023 12:27:19 +0000 Message-ID: References: <87il6bt4z0.fsf@yahoo.com> <87y1f6s3eb.fsf@yahoo.com> <4b3eacb7-9b0b-7167-d9ef-4d06167b5411@gutov.dev> <87il69qe0h.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3201"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 11 13:25:33 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1n3N-0000dM-9k for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Nov 2023 13:25:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1n2O-0005fH-UI; Sat, 11 Nov 2023 07:24:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1n2N-0005eu-NT for emacs-devel@gnu.org; Sat, 11 Nov 2023 07:24:31 -0500 Original-Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1n2J-00076X-Ke for emacs-devel@gnu.org; Sat, 11 Nov 2023 07:24:31 -0500 Original-Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507cee17b00so3793790e87.2 for ; Sat, 11 Nov 2023 04:24:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699705466; x=1700310266; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=i3gdRNHSuYU2+CL8cx4gwZfQ0UWhupVfk0zPha/LGUc=; b=R0JRk197vZ0n/pCug8+0nuZd5teoaBSQglLH2N+e69eZIJvHAdznhIci5GIvDXd4LI bI/uRAJO5UIQxkLXkzpRn9juE/ugjXwDQH2K08NFseTLLZL9UiiTU0zVzPfSIoUElpsK nU67HtNjnLacbZEWOvd8mmSftoB1QcrnqlKF7q0skCH/ONLs/UQPEYHlXM5ZfX1+16yd Hot0RBmYKZ1PE8MGMxtuNyHbO8W1FZsXrWPsIGmFXJZwwF8Pl7iIEB3GQ2ZKOpIpyA3U rp+246PtXQQittt18Xre+IBRmNDDiMj2fGakI+9ksSunFy7Kc+cuuyTubwXuhx1kF0QK ap7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699705466; x=1700310266; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i3gdRNHSuYU2+CL8cx4gwZfQ0UWhupVfk0zPha/LGUc=; b=SEA3Bb9DbUuFzWyOWOzLdqXBasUKOTzYvdMEs6tIbtyjXNhC1lpcjUcNgfCWMQVwKx FwLVmjHaxkpPutHUbJHZsP4DDNtoNmjxqMMsQ1p9XLDzv5uNL3ZuWXR05xSgHRWXGKBv xIbk1BFbpiAmbFPTi2/rKfI2zcdL08lW9F5ZVUgUKwYsQMkgzR2H2jqCXqOPuAWkf8RF gtIi2hK5ybsyMcDeAF7yrEhKA/4/IFNymnCvIyciWV/k/kcZbnv9DLeeZr9YqHxPBGlX X7TD1oPARsf3xnTw5pWEQy0sh/8M7Dd4Ax+i0nF8q6DhNQ7Ak2lvajPZpWWzCkxwMXdO /R6w== X-Gm-Message-State: AOJu0Yzx/LjlW1ysE8BOJ3J127uONbkeVcwRNO/DXXkmtvQufFBeMaKf /aj0HLWmM5UWtg5V2rSKkY1qiCEB7q+JgRmyBf64GyRajgeduA== X-Google-Smtp-Source: AGHT+IEGM3dRoaH+FE3p9zCkVODvJ5tFKskHpFFXhJ2O46Q6aJO8Ea1eLzdHJdPOsjKtmXV45mFPrKkzObpnGeilvVA= X-Received: by 2002:ac2:44b9:0:b0:507:a087:622a with SMTP id c25-20020ac244b9000000b00507a087622amr1070158lfm.60.1699705465604; Sat, 11 Nov 2023 04:24:25 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312548 Archived-At: On Sat, Nov 11, 2023 at 6:12=E2=80=AFAM wrote: > > On Sat, Nov 11, 2023 at 09:23:26AM +0800, Po Lu wrote: > > Dmitry Gutov writes: > > > > > Just to take this example, there are about 2 major bugs: 1) the list > > > will come out reversed, 2) the code does XOR rather than subtraction. > > > > Hmm, reading its doc string, I think a more illustrative name for > > cl-set-difference would be cl-set-complement. In this case, the second > > loop can be removed. > > Yes, "difference" is, surprisingly, ambiguous. I wouldn't say "ambiguous", but this page has a brief review of different ways the operation is referred to in literature. https://proofwiki.org/wiki/Definition:Set_Difference/Also_known_as In programming languages "set difference" seems to be the overwhelmingly established term https://cplusplus.com/reference/algorithm/set_difference/ http://clhs.lisp.se/Body/f_set_di.htm https://docs.python.org/3/library/stdtypes.html#set https://ruby-doc.org/core-1.9.3/Array.html#method-i-2D https://doc.rust-lang.org/std/collections/struct.HashSet.html#method.diff= erence > Your implementation is > usually called "symmetric difference" to avoid that. Correct.