all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Philip Kaludercic <philipk@posteo.net>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: cl-loop and plists vs alists
Date: Mon, 26 Dec 2022 00:35:58 +0000	[thread overview]
Message-ID: <CALDnm53BP8M4g6A18rOR7kUR8r+OpNoy1YOweG_kQX+dqN+LCQ@mail.gmail.com> (raw)
In-Reply-To: <87h6xjm3au.fsf_-_@posteo.net>

[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]

On Mon, Dec 26, 2022 at 12:11 AM Philip Kaludercic <philipk@posteo.net>
wrote:


> > Until you step into the real world and you have to.
>
> Can you elaborate this point?  Is this by intrinsic necessity or due to
> the "mistakes" of others.


Nothing special to elaborate.  If a data structure is a plist and you can't
change that, and you need to manipulate it, you're in the real world.


> Plists are "harder" to iterate, because your
> steps are cddrs which is an unusual way to run over a data structure.
> Same applies to adding and removing associations from a plist.  The
> advantage is that they are easier to write.


IMO the major advantage is that you can use them for lambda lists.


> Maybe somebody knows the history here, why and where which of the two
> were used.  Again, my hunch is that going by the respective strengths
> and weaknesses of the two (in relation to the conventional tools), we
> can give some heuristic of when it is /better/ to use which of the two.
>

Both alists and plists are used intensely in at least two large commercial
CL systems I have worked with.  I also see them in OSS pretty often.

I get your point, but this example is geared towards cl-loop.  It is


It was your example. I just weaked it trivially to make it slightly more
realistic.

Of course LOOP isn't for _everything_, else we wouldn't need anything else.
It's a very versatile (and very often the most performant) util and that's
why
it's in the CL standard. The only thing approaching it is the ITERATE
macro,
modelled directly after LOOP, but that's not nearly as widespread and IMO
not improvement enough to be worth investing the effort.

[-- Attachment #2: Type: text/html, Size: 2700 bytes --]

  reply	other threads:[~2022-12-26  0:35 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 20:12 bug#60102: Move gv-expander of substring to cl-lib Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-16  6:56 ` Eli Zaretskii
2022-12-16 14:14   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 20:00     ` Stefan Kangas
2023-09-04 20:43       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-16  7:22 ` Juri Linkov
2022-12-20 18:42   ` cl-lib warnings (was: bug#60102: Move gv-expander of substring to cl-lib) Stefan Monnier
2022-12-21  8:37     ` cl-lib warnings Juri Linkov
2022-12-21 12:45       ` Eli Zaretskii
2022-12-21 12:57         ` João Távora
2022-12-21 13:47           ` Eli Zaretskii
2022-12-21 14:04             ` João Távora
2022-12-21 14:20               ` Eli Zaretskii
2022-12-21 14:35                 ` João Távora
2022-12-21 14:50                 ` Juanma Barranquero
2022-12-21 14:55                   ` João Távora
2022-12-21 14:57                     ` Juanma Barranquero
2022-12-21 15:08                       ` João Távora
2022-12-26  3:13                         ` Milan Glacier
2022-12-26 15:10                           ` João Távora
2022-12-26 23:48                             ` Milan Glacier
2022-12-27  0:05                               ` João Távora
2022-12-27  3:43                                 ` Tim Cross
2022-12-27 10:16                                   ` Lynn Winebarger
2022-12-27 13:00                                 ` Stefan Kangas
2022-12-21 17:14                   ` Eli Zaretskii
2022-12-21 22:33                     ` Juanma Barranquero
2022-12-22  7:13                       ` Eli Zaretskii
2022-12-22  7:23                         ` Juanma Barranquero
2022-12-22  8:53                           ` Eli Zaretskii
2022-12-22 22:24                         ` Yuan Fu
2022-12-22 23:56                           ` Stefan Monnier
2022-12-23  7:30                           ` Eli Zaretskii
2022-12-23 23:42                             ` Yuan Fu
2022-12-24  0:24                               ` Juanma Barranquero
2022-12-24 14:08                                 ` Stefan Monnier
2022-12-24 14:39                                   ` Juanma Barranquero
2022-12-24 19:13                                     ` Tomas Hlavaty
2022-12-24  0:26                               ` João Távora
2022-12-24 10:33                                 ` Philip Kaludercic
2022-12-24 11:01                                   ` João Távora
2022-12-26  0:11                                     ` cl-loop and plists vs alists Philip Kaludercic
2022-12-26  0:35                                       ` João Távora [this message]
2022-12-26 21:06                                         ` Bob Rogers
2022-12-24 22:59                                 ` cl-lib warnings Sean Whitton
2022-12-25  1:21                                   ` Stefan Monnier
2022-12-25  2:39                                     ` package-initialize was " T.V Raman
2022-12-25  4:11                                       ` T.V Raman
2022-12-26  0:01                                       ` Stefan Monnier
2022-12-26  2:18                                         ` T.V Raman
2022-12-25  7:02                                     ` tomas
2022-12-25  9:55                                       ` João Távora
2022-12-25 11:33                                         ` tomas
2022-12-26  4:47                                     ` Sean Whitton
2022-12-24  6:40                               ` Eli Zaretskii
2022-12-24 13:01                                 ` Dmitry Gutov
2023-01-06  5:40                   ` Sean Whitton
2023-01-06  7:34                     ` Eli Zaretskii
2023-01-06 17:58                       ` Sean Whitton
2023-01-06 18:14                         ` Eli Zaretskii
2023-01-06 19:03                           ` Sean Whitton
2023-01-06 19:45                             ` Eli Zaretskii
2022-12-21 14:15             ` Eli Zaretskii
2022-12-21 17:53         ` Stefan Monnier
2022-12-24 22:55           ` Sean Whitton
2022-12-25  7:05             ` tomas
2022-12-25  8:29           ` Juri Linkov

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

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

  git send-email \
    --in-reply-to=CALDnm53BP8M4g6A18rOR7kUR8r+OpNoy1YOweG_kQX+dqN+LCQ@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.