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 10:54:08 +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> <87y1f6s3eb.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="13571"; 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 11:55:29 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 1r1PAf-0003P0-8n for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Nov 2023 11:55:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1P9m-00032F-EL; Fri, 10 Nov 2023 05:54:35 -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 1r1P9j-000321-VD for emacs-devel@gnu.org; Fri, 10 Nov 2023 05:54:32 -0500 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1P9a-0006Ml-Rd for emacs-devel@gnu.org; Fri, 10 Nov 2023 05:54:24 -0500 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50943ccbbaeso2662899e87.2 for ; Fri, 10 Nov 2023 02:54:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699613661; x=1700218461; 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=9jxSaNCL+LzmuUthCrVJBwfswh1dLd52xT2s/UN+AbI=; b=PIM+yiIYZfqxe5D1SUptD73AQOwD5GDx/C0q7ldsOuTW36caD5ZZZiUticK34QOoNe 6VnVSMiXpgDm4RrCqf9myhyEIejn0sLsoTUOQ2RxsywH2wsXpGk1Y8PMS/7UUhZHqHh2 SkMoqQ/UI9Q4+rAIHbL4yyJzREV626F9n6KcAnruShQI2jBX2mvW5xzGbytSFQ5wpBlf kYb+qYXJe9rbfF7D6PxLTI6hbptw1m6VfKoZgdrjkdQI4Yx9OR9alYViuR6Ufs+RW/5E rEE8bIYf5vCGG3e236OzwqB/Ixt0Fz+ObsQ44BPzxh5l3H9jUEA9WL6Qzirekw2SB69K wzLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699613661; x=1700218461; 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=9jxSaNCL+LzmuUthCrVJBwfswh1dLd52xT2s/UN+AbI=; b=Go2l7apooctIWbUQ48wDZBewDFUynwbWtYlFf2ZRKAdn5H43OehsCF31faCjsGrnBv zyhH0QDqGZ6HO0Q7GMvskS+4LrHFke3NMbHIrejkDStmXyVNlqcGEMolY2Oy+0EgEaOb vR20o8hZ3sSXn8s3yBL67jMyjSOBxCBlSOBcbhhhN3xU6ih4jZ2/Hw7nFCMYrG8tZb9G dMJKajVz0zzR8fOLRfP5pdFaV8vpE/Z5XKifnUB+asEIbH+Jxipvp2OfNW2hs4YIz37O Z7SAR+Jkr93HrWCR2YV1884q4X0OGxwCMQTiaY8bxnWht1gmzHRZyRsfdByDBGEagwEY vi+w== X-Gm-Message-State: AOJu0YwHIqTEg5CVXAHzhOj4y+VSiWXK+UyyVT6o+TCisMK/SKWLDEXz VTz4V5vxNbRHUv2iFvFvYdlgLg3eNgTcelo62qU= X-Google-Smtp-Source: AGHT+IEsQZnaOverZcatXjxY00VRNTr5LvNwU+PoKXxm8zJQUqfYTeoDY/dIBBHgbX+tpKe1hWCWbAukmel+RWoRbL0= X-Received: by 2002:a05:6512:507:b0:508:225e:e79f with SMTP id o7-20020a056512050700b00508225ee79fmr3660401lfb.22.1699613660840; Fri, 10 Nov 2023 02:54:20 -0800 (PST) In-Reply-To: <87y1f6s3eb.fsf@yahoo.com> Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x12a.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:312473 Archived-At: On Fri, Nov 10, 2023 at 3:17=E2=80=AFAM Po Lu wrote: > > Jo=C3=A3o T=C3=A1vora writes: > > > 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. > > Which is tantamount to, or at least comes off as, arguing in favor of > that language's influence. No, not mounting any tantas, I was just making a joke. But yes, of course I like Common Lisp. I like C++ too (not as much, tho) and it pisses off C people, too. > Granted, the foregoing is something of an overstatement. But the > alacrity with which programmers seize at opportunities to employ cl-lib > does call for one. But that leitmotif is everywhere (and us much less strong in open-source, btw). Surely if you've ever worked at a large enough company you'll see bizarre code from people not working there anymore. And that goes for everything. You think everyone will forever be grateful to read your 300-line inline-all-the-things functions in touch-screen.el when you're not around to explain what they do? They won't. It makes no sense to single out any given library for this evil, especially not cl-lib.el which is a well-understood stable piece of kit. In Emacs core and just as strongly outside it. > > 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. > > Really? Here is one example to the contrary: keyword arguments. No > Emacs Lisp built-in takes them, yet it is scarcely possible to name a > Common Lisp list manipulation function that does not. Many examples of Emacs Lisp functions take them. Even Richard seems to have come around to their usefulness. CL functions take them in consistent ways, but you can use them without keyword arguments if you're stubborn enough. Anyway, it's not a "belief", it's just a good way to provide versatility for functions. > > 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. > > Yet few of these people consider the impact their decision makes to > others, who will in due course have the responsibility for reading this > code pawned off them. Why do you exempt yourself from this irresponsibility? Can't you see this is all subjective and it seems a bit arrogant to say "my code is so responsible"?? All code is bad. > > 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 pytho= n > > (let ((list nil)) > (dolist (x l1) > (unless (member x l2) > (push x list))) > (dolist (x l2) > (unless (member x l1) > (push x list))) > list) > > (catch 'tag > (let ((index 0)) > (dolist (tem someseq) > (when (eq (car tem) probe) > (throw 'tag index)) > (setq index (1+ index))))) Nuff said :-) . So if multiple set difference operations or multiple index-finding operations are needed you write these choo-choo trains again and again. That sure explains the 300 lines. > > 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". > > There's not much of a point in arguing against such patent absurdities > as considering the operation of setcar as complex as that of cl-labels, > is there? I guess not for human versions of --finline-functions who think, or rather "believe" that such common practices for code reuse as subroutine encapsulation is "balkanization". It's probably "patently ab= surd" for them yes. Jo=C3=A3o T=C3=A1vora