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: Tue, 14 Nov 2023 11:47:51 +0000 Message-ID: References: <12da6bcb-1818-7fbe-12af-8d4607724332@gutov.dev> <87il6bt4z0.fsf@yahoo.com> <8734xetjkk.fsf@yahoo.com> <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <83leb3v5al.fsf@gnu.org> <87a5rgrbvv.fsf@neko.mail-host-address-is-not-set> <87edgsmwni.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="38962"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tomas Hlavaty , rms@gnu.org, Eli Zaretskii , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 14 12:48:53 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 1r2ruX-0009tD-89 for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Nov 2023 12:48:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2rtq-0007Bk-UZ; Tue, 14 Nov 2023 06:48:10 -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 1r2rtp-0007Ba-EH for emacs-devel@gnu.org; Tue, 14 Nov 2023 06:48:09 -0500 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2rtn-0006ps-51; Tue, 14 Nov 2023 06:48:09 -0500 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-509c61e0cf4so6533500e87.2; Tue, 14 Nov 2023 03:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699962484; x=1700567284; 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=hnn7Ocl+MZKV5x+a3ThhyiOJ6HJSzIxkHdXEPwXPQ9U=; b=JahD/X3ic9kCDf760r1GaGYg9i/5Y91t0th9zxUDuMuXGMarNflh0Q5cIPunw/Xs/O QkyOSEfNAB2I1PFLg5tg+nr2uHD4d2ATq+eSOcC3cihQXzm9dm6/a85npEnZOhkJYYhq EQBvRuQUn2sXeKCR6iOg5Dfm+HkwVB42jWPDVWNdPj4h3NVrv4nG6sKe7TI+21pC81h0 L0OA0oVQD2ixUfSpQO6ttYN65l8559hbgzOwFfkE6v5QQeNLJbyhHIUmCYjKtWTLfYy3 hZhI9NdVzbXEHkTOoTE0+V7qt4k1UMqOrzTHJ9paPjtzn+ACjooqhPn/QfoeyoyuEqnq EN+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699962484; x=1700567284; 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=hnn7Ocl+MZKV5x+a3ThhyiOJ6HJSzIxkHdXEPwXPQ9U=; b=tld1P9krGQF9Wjs7KmczHAeN1i1ib8QG0QfJrwn185fpc3UKUXuZqGztZ+l8TgfKPU haPRR9pv9cS9vyJMjW6xg5uNb7mKIxGjcozy9hb89jHTHeAGCdTRR/hYByNUBslUQmLl mFlTnbaFLw9PiY8YDpeI/Ed8FHWf09UqCarKuLjuhZ0GRHQCF2rzOm9jAkjebV3Sp80G /XZfwoepE3t1UEmsMjOtSq55xRVkaYozigK9W4GRMth27oGZO0hPmveg8k94ohOelCmx eulxZCEhyntov30Y4+JaZdIG7bijwobbl9azwRF7WjHVOLGdk3VGbbw4n2fBvJOSozwr HrSg== X-Gm-Message-State: AOJu0YyRqGjku4UdveR7H2d31UqW9/2F0PPWcu5/yJKe+XTf4UiW7UVz wwHZStseN0+CzM2jE2PPvqqjUutgbaD/MOAUHQ46yl0XGs/KKg== X-Google-Smtp-Source: AGHT+IHaBX8gkZ1Jcv+edpZiFlSpg4RI/Xh+R8pboxjiLcQOuTNIziB6uNc6ediQY7ipUQKKgaxsZXO5NLHwxPicPPk= X-Received: by 2002:a19:2d4b:0:b0:507:9787:6776 with SMTP id t11-20020a192d4b000000b0050797876776mr6895280lft.5.1699962484051; Tue, 14 Nov 2023 03:48:04 -0800 (PST) In-Reply-To: <87edgsmwni.fsf@yahoo.com> Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x135.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:312723 Archived-At: On Tue, Nov 14, 2023 at 10:55=E2=80=AFAM Po Lu wrote: > The transformations carried out by cl-loop are by a > long shot more consequential to the structure of their input than those > by most any other macro there is That's true. > , which is a demerit That's not. LOOP, pcase, etc, like any other macros, are mini-languages. Like any higher-level language, the more powerful they are, the more transformations they will do on your input. LOOP is pretty powerful, and may or may not be suitable for the task at hand, like any other language. At any rate Tomas' translation of the loop is just plain wrong. Where is 'type-spec' being bound? It needs to be destructured: LOOP is a language which is very good at expressing this fact concisely in a self-documenting way: for (f type-spec) in comp-known-type-specifiers Here from this one line, without ever having looked at Andrea's code I learn that comp-known-type-specifiers is a list of 2-element lists, where each such tuple is at least made of an 'f' and a 'type-spec'. It would take longer (for me!) to learn this fact if 'car' and 'cadr' had been used in subsequent forms away from detached from a hypothetical (pop comp-known-type-specifiers). But again, that's just for me, and that's because I have learned the LOOP language, because I thought it was worth learning just for reading other people's code. And it sure was. But if you don't want to learn it, for whatever personal reason, open up the macroexpansion, or step through the function with edebug. To each his own. Anyway Tomas' example, if it were to be corrected, would become "ugly" perhaps "uglier" (as if "ugly" were even an objective thing) Here, I think dolist + pcase-let/cl-destructuring-case/seq-let would also be appropriate. Though I'm sure someone out there would find it insufferably ugly or anti-Elisp as well. Jo=C3=A3o