From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: 7 logical-xor implementations in source tree Date: Thu, 01 Aug 2019 03:09:04 +0300 Message-ID: <87tvb1sq5b.fsf@tcd.ie> References: <87tvbd9a8p.fsf@oremacs.com> <87pnm14u95.fsf@tcd.ie> <87sgqvoz5c.fsf@tcd.ie> <87d0hz2e11.fsf@tcd.ie> <5B633129-B795-4BFA-AE81-FE9FD0A24CE9@acm.org> <0edfffbb-6f5a-a6b2-334a-9000e8f2eb3e@gmail.com> <20190728080417.GA5072@ACM> <875znm3q19.fsf@mbork.pl> <20190730093651.GA5427@ACM> <7n36iny4yq.fsf@ecube.ecubist.org> <7nftmmkz83.fsf@ecube.ecubist.org> <87y30e6j5b.fsf@web.de> <4de86e2c-18ab-4cf1-9a70-e43310234ad0@default> <87r265yi4r.fsf@tcd.ie> <5e36d18d-5a51-410e-9cd2-d03ba62aca0f@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18267"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Michael Heerdegen , Barry Fishman , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 01 02:09:35 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsyf0-0004f6-QB for ged-emacs-devel@m.gmane.org; Thu, 01 Aug 2019 02:09:34 +0200 Original-Received: from localhost ([::1]:45130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsyez-0005WM-Rw for ged-emacs-devel@m.gmane.org; Wed, 31 Jul 2019 20:09:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38424) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsyeh-0005W1-1y for emacs-devel@gnu.org; Wed, 31 Jul 2019 20:09:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsyef-0001T4-TU for emacs-devel@gnu.org; Wed, 31 Jul 2019 20:09:14 -0400 Original-Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:50341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsyef-0001Ot-EB for emacs-devel@gnu.org; Wed, 31 Jul 2019 20:09:13 -0400 Original-Received: by mail-wm1-x341.google.com with SMTP id v15so62699909wml.0 for ; Wed, 31 Jul 2019 17:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MtvQ3xlr44cwDp/5jTlDZZHprsaVaVu4MxaIdb/MM6A=; b=ohJMxT1yiUZCI7msD7XFNGZL/yVfDm5Y7lFQ6FAn7OqZuqOIhqMuZpJLDk9dMjsf2T jxsIjSuxF3BbyAu2gimqdeJ+TLZddBsiBmZOIqgUDhafjfUAkvgmGzSd3rytRD13TK92 jC5B1jnoUrzbo/NZBEgAjndJqLPZoFdHW615QZJhaeo6puHd1+VCA7tDKnUSCH5Xmzee 1NzPafDbiDaJyIOC8S4r4tff62YDTMiNT2k/5d1YObMYG4OEO4u1yVqfvmnywEMJdeNz K09gnvlYDhl2p8o7r7Mra+co9HCHtVEXtPYwA5qswgkkYFYaP8QlywogLhckdb1lNYNk zh6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MtvQ3xlr44cwDp/5jTlDZZHprsaVaVu4MxaIdb/MM6A=; b=jnYveUGWwRxJ4tjS6QO/m+A667ZZ2uGIRj5P6dbyw3sJsZxMFfWkLSfQWBrtbVCp3F QctJYte6GYFpLff7Jn5iLDoVgKby4OG6pBLpx6cFSo9PNCrxCwB7hE6SWHh8WLcPKBQR piZDzMmImM0vsfX2lJPGCqrJNJlU9InnIuPpy/ubI/AyjgyfKqEFkDW+MIctJg7l3jdu npC9YHIVJbjLz73Bb+C+Ke5CK3uaG3oOZhjxgYXzi8ljORK00O9mXoRyUYRjqPuml2xt Mlwgna9skS39xrIsBMdis7V9bdKngKuHCDSnsrScEP0a00XIkBvPz1mTFGRFtm16clZG UnLg== X-Gm-Message-State: APjAAAXdse+OgCovuzKQhz7m1hvc323ubQAWFRGAG0MyMNbYQGiKQiSa E4ycWblLeclieXTRuzzmf191Tg== X-Google-Smtp-Source: APXvYqwihGZHzPrC9kPc/kG7J/aIdwbflp9VNewCS6c1rPQFYP5XyNulZ2hO3LZIbp4wQrv0AkPuhQ== X-Received: by 2002:a1c:99ca:: with SMTP id b193mr109745902wme.31.1564618152171; Wed, 31 Jul 2019 17:09:12 -0700 (PDT) Original-Received: from localhost (adsl-131.91.140.89.tellas.gr. [91.140.89.131]) by smtp.gmail.com with ESMTPSA id f204sm107189476wme.18.2019.07.31.17.09.11 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 17:09:11 -0700 (PDT) In-Reply-To: <5e36d18d-5a51-410e-9cd2-d03ba62aca0f@default> (Drew Adams's message of "Wed, 31 Jul 2019 16:20:57 -0700 (PDT)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239078 Archived-At: Drew Adams writes: >> > Why is it important that Emacs Lisp have such >> > an operator? (Answer: it's not - YAGNI.) >> >> If YAGNI, why are there currently 7 copies of this function in the >> Emacs sources? > > Dunno. I probably wouldn't have added them. Then we're not talking about the same Y in YAGNI. ;) > OK, so we have 7 definitions of a trivial function. > How many occurrences of those 7 functions? You can see all 17 in-tree occurrences in the patch(es) proposed elsewhere in this thread. There exist also further copies and occurrences in some GNU ELPA and MELPA packages. > Do their uses really benefit from defining such a function? I think they allow the relevant code to remain more succinct and clear. > (How about just replacing all of them by sexps?) I invite you to try it, but I don't expect the diff or result to be that pretty, especially not in idlwave.el. >> No-one said it's vitally important; it's just a minor nice-to-have. > > Just 1 opinion: too minor and not nice enough to have. I think the OP, as well as most follow-ups in this thread, indicate the opposite. >> > Is it hard to understand (eq (not a) (not b))? >> > Is evaluation of that inefficient? Is it too >> > verbose? What's the motivation for all of this? >> >> Same reason proper-list-p was added: reducing existing code duplication >> and providing yet another convenience function for those that like it. > > I see. You added `proper-list-p' also. Also missing > from Common Lisp, FWIW. > > How much real code duplication did adding that predicate > eliminate? At least in that case the code replaced is, > even if straightforward and not very verbose, not > completely trivial. > > I don't object strongly to adding such functions. > But I'd expect a convenience function to typically be > more convenient - replace more than a few occurrences > of more complex code. The point is not just eliminating existing duplication, but also providing a named convenience function for future use (both naming and convenience are useful in general). You may not see the utility in this case (which is perfectly understandable) but it is clear to me that several others do. (See also the recent discussion on decoded time accessors.) Thanks, -- Basil