unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: [External] : Re: Closures - do you understand them well?
Date: Thu, 22 Dec 2022 00:53:03 +0100	[thread overview]
Message-ID: <87zgbg1fhc.fsf@dataswamp.org> (raw)
In-Reply-To: SJ0PR10MB5488BBBF041023ACB8C1694AF31F9@SJ0PR10MB5488.namprd10.prod.outlook.com

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




  parent reply	other threads:[~2022-12-21 23:53 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 15:36 Closures - do you understand them well? Michael Heerdegen
2022-12-08 16:24 ` [External] : " Drew Adams
2022-12-08 17:30   ` Michael Heerdegen
2022-12-08 17:56     ` Drew Adams
2022-12-08 18:00       ` Drew Adams
2022-12-08 18:49       ` Michael Heerdegen
2022-12-08 19:35         ` Drew Adams
2022-12-10  4:51           ` Emanuel Berg
2022-12-08 19:45         ` Drew Adams
2022-12-08 19:06 ` Tassilo Horn
2022-12-08 19:53   ` Michael Heerdegen
2022-12-08 20:01     ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-08 20:49       ` Michael Heerdegen
2022-12-08 22:00         ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-08 22:25           ` [External] : " Drew Adams
2022-12-08 22:51             ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-10  2:34               ` Emanuel Berg
2022-12-09  5:03             ` Tomas Hlavaty
2022-12-10  2:35               ` Emanuel Berg
2022-12-10  2:29             ` Emanuel Berg
2022-12-10 16:56               ` Drew Adams
2022-12-15  8:25                 ` Emanuel Berg
2022-12-09  4:49           ` tomas
2022-12-09 19:40             ` Michael Heerdegen
2022-12-09 19:50               ` tomas
2022-12-09 20:55               ` Tassilo Horn
2022-12-09 21:21                 ` Michael Heerdegen
2022-12-09 21:31                   ` Emanuel Berg
2022-12-09 21:23                 ` Emanuel Berg
2022-12-10 11:40                   ` tomas
2022-12-12  1:18                     ` Michael Heerdegen
2022-12-12  5:16                       ` tomas
2022-12-12  6:09                         ` Michael Heerdegen
2023-01-18 12:13                           ` Emanuel Berg
2023-01-19 13:21                             ` Michael Heerdegen
2023-01-27 20:24                               ` Emanuel Berg
2023-01-28  0:44                                 ` Michael Heerdegen
2023-02-26 12:45                                   ` Emanuel Berg
2023-02-27  8:33                                     ` tomas
2023-02-28 10:13                                     ` Michael Heerdegen
2023-03-01 20:42                                       ` Emanuel Berg
2023-03-03 12:09                                         ` Michael Heerdegen
2023-03-02 11:08                                       ` Michael Heerdegen
2023-03-02 18:25                                         ` Emanuel Berg
2023-03-02 20:48                                           ` Emanuel Berg
2023-03-03  6:56                                             ` Eli Zaretskii
2023-03-03 12:19                                             ` Michael Heerdegen
2023-03-02 18:37                                         ` Emanuel Berg
2023-03-02 18:50                                         ` Emanuel Berg
2023-01-18 12:11                         ` Emanuel Berg
2022-12-22  4:00                     ` Emanuel Berg
2022-12-23  6:27                       ` tomas
2023-01-18 12:23                         ` Emanuel Berg
2022-12-10  4:46                 ` Emanuel Berg
2022-12-10  0:12               ` Michael Heerdegen
2022-12-10  9:34                 ` Tassilo Horn
2022-12-10 10:02                   ` Emanuel Berg
2022-12-10 16:28                   ` Mutation - do you understand it really? (was: Closures - do you understand them well?) Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-10 18:29                     ` Mutation - do you understand it really? Michael Heerdegen
2023-01-18 10:58                       ` Emanuel Berg
2023-01-19 13:59                         ` Michael Heerdegen
2023-01-19 17:47                           ` [External] : " Drew Adams
2022-12-11  2:24                   ` Closures - do you understand them well? Michael Heerdegen
2022-12-11  9:13                     ` Tassilo Horn
2022-12-10  2:26           ` Emanuel Berg
2022-12-10 17:20             ` [External] : " Drew Adams
2022-12-10 18:02               ` Iteration macros (was: [External] : Re: Closures - do you understand them well?) Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-10 20:38                 ` Drew Adams
2023-01-18 11:10                   ` Emanuel Berg
2023-01-18 11:08                 ` Emanuel Berg
2022-12-21 23:53               ` Emanuel Berg [this message]
2022-12-09  3:43         ` Closures - do you understand them well? Emanuel Berg
2022-12-09  4:01           ` Michael Heerdegen
2022-12-09  4:38             ` tomas
2022-12-09  5:37               ` Emanuel Berg
2022-12-09 16:55                 ` Michael Heerdegen
2022-12-10  4:52             ` Emanuel Berg
2022-12-08 19:44 ` Eric Abrahamsen
2022-12-08 20:11   ` Emanuel Berg
2022-12-08 20:53   ` Michael Heerdegen
2022-12-08 23:25     ` Michael Heerdegen
2022-12-09 16:50       ` Eric Abrahamsen
2022-12-09 18:48         ` Emanuel Berg
2022-12-09 19:25         ` Michael Heerdegen
2022-12-11 18:42           ` Eric Abrahamsen
2023-01-18 12:08             ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgbg1fhc.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).