From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: [External] : Re: Closures - do you understand them well? Date: Thu, 22 Dec 2022 00:53:03 +0100 Message-ID: <87zgbg1fhc.fsf@dataswamp.org> References: <87lenh7vrn.fsf@web.de> <87tu25d77o.fsf@gnu.org> <87h6y5pt8k.fsf@web.de> <87bkodpqnk.fsf@web.de> <87tu24yowj.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39312"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:FXfP2VeLoVxK4YsMpLYSAu2KJ7s= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 22 02:59:20 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1p8Arf-0009zY-Mn for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Dec 2022 02:59:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8ArE-0000k9-Cn; Wed, 21 Dec 2022 20:58:52 -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 1p88th-0000JW-Ei for help-gnu-emacs@gnu.org; Wed, 21 Dec 2022 18:53:17 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p88tf-0005dB-L4 for help-gnu-emacs@gnu.org; Wed, 21 Dec 2022 18:53:17 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1p88td-00023T-JR for help-gnu-emacs@gnu.org; Thu, 22 Dec 2022 00:53:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 21 Dec 2022 20:58:51 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141894 Archived-At: Drew Adams wrote: >>> Indeed, when I looked at it, I decided it was too much >>> trouble figuring out how to change `cl-loop` to provide >>> that behavior :-( IMO `cl-loop` is too complex for its >>> own good. >> >> All of Lisp is, and the reason is it's so simple to begin >> with ... > > Most likely Stefan meant that the code implementing > `cl-loop' is complex - even too complex for its own good > (it's a bother to maintain/improve/correct). Okay, maybe that complexity have something to do with the huge scope of what you can do with that in so many ways? And why I think it's cool with things that breaks the pattern ... I don't want a lot of Lisp, the Lisp I use, to be like that. But it's fun, it feels like the land of total loop freedom which I didn't know existed :) In the computer books I read as a kid they always said the for loop was much more modern an better than the while loop, the do ... until loop, and wasn't there a 'wend' loop as well, whatever that did. I believed it then, now I'm so sure. The while loop is useful and the for loop is useful, but, for specific datastructures, there should be specific loops, one shouldn't, IMO, iterate that manually with the for-increment-i unless there is some extra spanner one wants to throw somewhere in particular which the standard datastructure-loop function doesn't do ... The result of that will also be a nice set of often use datastructures, all with associated, trusted loop functions people can the compete to optimize. So it's de facto standardization which leads to, yeah, better code and better software I guess. So yeah, in a way cl-loop in all it's scope is like the opposite of that, instead of nicely dedicated it can do everything - including being dedicated because it has that as well - but again, I'm a maximalist, I don't want what's best or makes the most sense, well I want that as well, because I want EVERYTHING! > But it's also the case that for a _user_ the syntax > of `(cl-)loop' is complex - certainly much more > complex than the usual Lisp syntax. You essentially > have to learn another language - `loop' - to use it. Maybe an exaggeration but in a matter of speaking, yes, in particular the 'with i = 0' looks like, I don't now, some dialect of SQL? > That's one of the arguments in favor of using macro > `iterate' instead: its syntax is more "lispy". `cl-loop' is, or can be, much less lispy, yes. > Users can of course learn the language of `loop', > just as they can learn the language of Unix `find', > and just as they can learn the language (patterns) > of regular expressions, or those of `pcase'. With `cl-loop' it's too much, no doubt about it, still it's there so why reduce it if it's useful. I would stop using it if all of Elisp was like that but it isn't so hey, relax. `cl-loop is cool B) It is much more powerful (expressive) than the C or C++ for loop in ways that I do understand, and I don't understand all if (cl-lib), by far :) > Nevertheless, it remains true that a second/separate > language is introduced. That can present advantages (code > can often look like simple English commands), but it also > presents disadvantages. Indeed, keep Lisp the old way, no more `cl-loop' style stuff and where it appear, don't put everything in one function, is what I wouldn't do! > It's largely a question of taste/style, and > "Des goƻts Interesting so "circumflex DNC" (line 83) in the Linux VT: https://dataswamp.org/~incal/conf/vt/remap.inc > (The rule behind Occam's taste & color preferences, perhaps, > but a good rule of thumb nevertheless. The taste question > comes in when deciding just which multiplying is > "unnecessary".) Whaat??? -- underground experts united https://dataswamp.org/~incal