From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Fri, 10 Nov 2023 11:17:32 +0800 Message-ID: <87y1f6s3eb.fsf@yahoo.com> 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="22652"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Alan Mackenzie , Dmitry Gutov , =?utf-8?Q?Bj=C3=B6rn?= Bidar , emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 10 04:18:48 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 1r1I2h-0005ip-5J for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Nov 2023 04:18:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1I1l-0005P2-2Z; Thu, 09 Nov 2023 22:17:49 -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 1r1I1j-0005K7-EX for emacs-devel@gnu.org; Thu, 09 Nov 2023 22:17:47 -0500 Original-Received: from sonic302-20.consmr.mail.ne1.yahoo.com ([66.163.186.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1I1g-0001q3-Md for emacs-devel@gnu.org; Thu, 09 Nov 2023 22:17:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1699586261; bh=Ish0HySDair6+9461DC9aoREvXcwrYToAZvmslR0Nm8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Ll0NxWJ73meLCruAQ2bLf5DQ5cg94ISOjcUVaSqdRHfuX4BkxKEc1BJ4JPkOIG9A2kAH2i/RDFeHPSNlp3gqx1x8aL4atdyuFWUbE6l60nAAe8hjLgF2m5JJwCoYhYlGH9sGzEAbYOgYcZBPmUMqaZ6x2Ib+MNKAMImNitDicfEaXSk6eWUiCZ2U/pR8MIK+6kkTf6I1XhkXBoAxLXxYnw9Kqcd9hLzYEM7JvU0Gnv+HuGcN2nlXrKnWZac9CMYBIm0zXu/aHYMcaZuI10W+3tirPDgZKGFSE8T3jytg6ffCl0VEBmSbt/DeRp4grz5Nyp1F0mrl99JjHOc5gJsQ4Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1699586261; bh=o56A+Z60LBwoXQw6WJ/b23+ym6ufZTk/zUHMYXo0YJ7=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Y1eVsJB54ZSZ3sUAtQXh2KQwgQ2CTotm4d6Q9S7r3OVVImNa122lb8eKotKQD0U9BV31773zfgiYy8t5l+rrFWyXNlCdbi/LrAao0qgPYzOldKS2HK91ikLV/r1yw+f1QS3z26VdtDmOcywKXeoQBUvYtydlhPJFwloPb1QHeNkYlW257MDz6HZIdd3Zdyd52HJ1oDfe9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8dc-2ee56621921d Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Fri, 10 Nov 2023 03:17:41 +0000 Original-Received: by hermes--production-sg3-8696d769c6-p7cfj (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b40db46e84d32d440526fde53b19e2d4; Fri, 10 Nov 2023 03:17:36 +0000 (UTC) In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Fri, 10 Nov 2023 02:09:18 +0000") X-Mailer: WebService/1.1.21896 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.146; envelope-from=luangruo@yahoo.com; helo=sonic302-20.consmr.mail.ne1.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, 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:312456 Archived-At: 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. > 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? I know how packages function under Common Lisp, but they are not salvation. My objective is not to write code free of Common Lisp influence; this I already do. It is for everyone else to write them, or provide a 95% effective guarantee that I (and many others) will never have to read them, which is easier said than done; a leitmotif in Emacs development is for active developers to vanish overnight, leaving a small corps of developers with reponsibility for their upkeep in the years that follow. 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. > 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. > 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. > 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 (let ((list nil)) (dolist (x l1) (unless (member x l2) (push x list))) (dolist (x l2) (unless (member x l1) (push x list))) list) > 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. (catch 'tag (let ((index 0)) (dolist (tem someseq) (when (eq (car tem) probe) (throw 'tag index)) (setq index (1+ index))))) > 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? > 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 :-) I think not. > 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. It doesn't bother me that functions for whom there are no reasons to use their constituents elsewhere have yet to be balkanized, no.