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: Fri, 10 Nov 2023 02:09:18 +0000 Message-ID: References: <871qd8sfdx.fsf@posteo.net> <838r7g8pys.fsf@gnu.org> <87bkcbrgnr.fsf@posteo.net> <25924.21015.19614.951576@orion.rgrjr.com> <87bkc4jpja.fsf@dataswamp.org> <12da6bcb-1818-7fbe-12af-8d4607724332@gutov.dev> <87il6bt4z0.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="20227"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Mackenzie , Dmitry Gutov , =?UTF-8?B?QmrDtnJuIEJpZGFy?= , emacs-devel To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 10 03:10:27 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 1r1GyY-00055T-HI for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Nov 2023 03:10:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1Gxo-0008Vz-Fr; Thu, 09 Nov 2023 21:09:40 -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 1r1Gxm-0008Vk-0m for emacs-devel@gnu.org; Thu, 09 Nov 2023 21:09:38 -0500 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1Gxk-00054W-1h for emacs-devel@gnu.org; Thu, 09 Nov 2023 21:09:37 -0500 Original-Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507cee17b00so1946573e87.2 for ; Thu, 09 Nov 2023 18:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699582173; x=1700186973; 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=ZJYiGOseRY2CC3AglJSzf4AyBemuYm04IMQEnlM5b5k=; b=iik04OmyKn9ct4DyT4ufrLIczRZF9TlC08P/bdJfKqR2VpoOKhnsPnxOi8/YSeGo/4 ge+Xlfb+tyEcLqz4g2H/CFjNsojPg3WebNiIcONKSAoertsZddhkZ4Bv1T0sKoa6NI6G Gblv3HqIlXZxRwtbbPUbG30Skrit326eCRTzuSILHwqkJXzk3uXmzsD/urdfEC2advhD Cr7PzluHDjZJSXFwdx4I3PHoUTKLRfUr1zx1fLgYdaH4ERY/WaDVx3GRQLwVzYaWdui8 2gyCf1mMxKgZgcdx1brfJbM3hBADxvdP+VFPdirruLVUyM3QVQlQ0lsaLFQNSoVksGIF +NAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699582173; x=1700186973; 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=ZJYiGOseRY2CC3AglJSzf4AyBemuYm04IMQEnlM5b5k=; b=i6krz5xR20N5CquLi9MHlCp350Rxvq9vruJZP3dus0rm1+TmiO0BwSIwQv/Z20IPB8 jD3RlsyRLvWvFc7O+C5z7ssU9i1W2/YyFig4+QAarNjKmw564J58+SczfsMXD4rKI4cv sVkiWXk+i/5pbZwg6VvoqQ/QG9HWW8drRyzchuthTJsVuSG4MKbAFrUKSe1meYzJYmY9 04WzL/VIGYWoQ4m4ZGx9C/58PHVmq/YLF/0RMBTZbqg/JdsqClSFEWJRT14F7NpbgMo4 FMOz1hU3GRkNje3KwKx9TfL3jiU4HqqmtIYJbq2lRfTvESrI9e00oUjiVtJxXnUKVL5d TE8g== X-Gm-Message-State: AOJu0Yyf4A5AbxDZzhjRp93+giW2HNJ+/5zRGW4/eisvlkURKM1n+Sos 2v5xEewKsc8VUocRHmEKUek86K0nCJqnZLEoqsI= X-Google-Smtp-Source: AGHT+IFvS4Y73PJQNGnXnEHFYFKkuZZRQAHz5qbhVItVxHKE2h7QDpuRIgOlW+o6ZF/RhBP1ey8Ak4jypZRnVq91IUI= X-Received: by 2002:ac2:4adb:0:b0:509:8e3d:7cb0 with SMTP id m27-20020ac24adb000000b005098e3d7cb0mr2462120lfp.41.1699582172671; Thu, 09 Nov 2023 18:09:32 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x136.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:312451 Archived-At: On Fri, Nov 10, 2023 at 12:32=E2=80=AFAM Po Lu wrote: > > Jo=C3=A3o T=C3=A1vora writes: > > > Are _you_ the suit? I missed the point of most of your very > > elegant text, but isn't policy-making exactly what you (and I) are > > trying to do, i.e. discourage some things and encourage others? > > I'm not advocating partitioning Elisp into compartments, and to give > countenance to some of them on the grounds of the stature of their > designers. That's your proposal. What the heck? What I said, is that if Elisp _had_ better ways of making compartments, such as namespaces, managing which compartments are preferred in certain parts of code would be easier. I stated multiple times that I tend to trust developers to pick the tools they find most appropriate for the job. I simply stated that it's funny and ironic that the language whose influence you're trying to exorcize is precisely the one with one of the best tools to do that exorcizing. Maybe you didn't understand this because you're not familiar with CL packages, so I can explain. In CL you can actually write a program in a package that doesn't ':USE' the :COMMON-LISP package at all, or that only imports a handful of symbols from it (maybe the sacred Elisp subset). Or you can make your own packages with just the symbols you want and maybe use that. Meaning you'd be effectively insulated from CL or at least the parts you don't like and could write your perfect purist Lisp program. Come on, isn't that funny? > 3. cl-lib also defines a number of functions imported from a different > programming language, the beliefs underlying whose design don't > align with those of Emacs. There are no "beliefs" in Common Lisp's, neither should there be in Elisp. I don't think it helps your case to repeatedly evoke religion. > Therefore, we should discourage cl-lib from being introduced in the > first place, because its proliferation will render programmers more > eager to use it without considering its implications. Every other choice also has "implications". Most people favourable to cl-lib in this discussion know why they chose to use its functions. I wouldn't be so condescending. > > Also, is really cl-set-difference to take the difference > > of two sets worse than writing a "hallowed" multi-line > > construct?? Maybe I'm not seeing what the construct is, so > > what is your preferred Elisp hallowed way to take the > > difference of two sets, say make a list that contains > > all items that appear in LIST1 but not LIST2? Or to find > > the index of a certain element of a sequence... > > dolist with a catch/throw, or dolist, member and push? Hmmm, a bit vague, no? Humor me: if it's really so easy and so readable please write out your preferred equivalent of, say (cl-set-difference l1 l2) ; hopefully obvious, like l1 - l2 in python and ;; iterate through someseq and find index of first element ;; whose car matches probe according to 'probe-equals'. (cl-position probe someseq :key #'car :test #'probe-equals) Shouldn't take long. I can try myself, of course, but I think it's fair to give the proponent of the alternate approach a shot before comparing the two approaches. > My point was that comparing rplaca to cl-lib is much the same as > comparing apples to oranges, since rplaca is an _alias_ to setcar. Some get confused by cl-labels, some by archaic things like rplaca, some by new stuff like static-if. Doesn't matter what is alias to what, when you see both these things in code you don't know what they do until you look them up. And many times you'll think "there's a much better way". > Well, touch-screen.el is a good example of that. OK. So, basically, your code :-) '(if x (progn ...))' instead of 'cond', and lots of handrolled catch/throw with while t. OK fine. I have a feeling I think you'd love cl-loop, maybe even too much :-) Also quite some long functions there. 300 lines? Maybe typing "touch-screen" each time to define and call functions discourages you from modularizing more? Or maybe it doesn't bother you at all, so fine. Don't get me wrong, I am very thankful for your contributions, I really am. Write Elisp code in the manner you find most comfortable. But there are programmers working on problem domains in the core other than touch-screen.el, maybe with different non-C backgrounds. Many of them are historical contributors to Emacs. Jo=C3=A3o