emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cl-loop and plists vs alists


From: Bob Rogers
Subject: Re: cl-loop and plists vs alists
Date: Mon, 26 Dec 2022 13:06:29 -0800

   From: João Távora <joaotavora@gmail.com>
   Date: Mon, 26 Dec 2022 00:35:58 +0000

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

   . . .

   > 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.

Indeed, when I was hacking Lisp in the 80's and early 90's, by far the
most common application of iterating through plists that I saw was
processing &key parameters in &rest lists.  (This was the only time I
would use loop, albeit grudgingly.)  Otherwise, given a free hand, an
alist was the better data structure choice.

                                        -- Bob Rogers
                                           http://www.rgrjr.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]