[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: plist-based package.el (was Re: cl-defstruct-based package.el, now w
From: |
Ted Zlatanov |
Subject: |
Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!) |
Date: |
Thu, 06 Jun 2013 08:51:06 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
On Thu, 06 Jun 2013 18:30:11 +0900 "Stephen J. Turnbull" <address@hidden>
wrote:
SJT> Ted Zlatanov writes:
>> plists as a sequence of odd=key and even=value don't actually associate
>> the key with the value, unlike hashtables and alists.
SJT> They do if you use plist-put and plist-get. If you use list
SJT> primitives, you get what you deserve, which may not always be what you
SJT> want....
The association is positional. All you have to do is insert an element
in the middle of the list and the plist is broken. Also there's no
iteration primitive, so you have to use something like
#+begin_src lisp
(setq keys (loop for i below (length spec) by 2
collect (nth i spec)))
#+end_src
By contrast, an alist is an actual list of association cells that works
with `mapcar', and a hashtable is opaque so you don't know or care how
the association is maintained, but you can't screw it up.
Ted
- plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Daniel Hackney, 2013/06/04
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Dmitry Gutov, 2013/06/04
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Ted Zlatanov, 2013/06/05
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Stefan Monnier, 2013/06/05
- RE: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Drew Adams, 2013/06/05
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Ted Zlatanov, 2013/06/05
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Stephen J. Turnbull, 2013/06/06
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!),
Ted Zlatanov <=
- Re: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!), Stephen J. Turnbull, 2013/06/06
- opaque data types (was: plist-based package.el (was Re: cl-defstruct-based package.el, now with ert tests and no external tar!)), Ted Zlatanov, 2013/06/07
- Re: opaque data types, Christopher Schmidt, 2013/06/07
- Re: opaque data types, Ted Zlatanov, 2013/06/07
- Re: opaque data types, Christopher Schmidt, 2013/06/07
- Re: opaque data types, Ted Zlatanov, 2013/06/07
- Re: opaque data types, Christopher Schmidt, 2013/06/08
- Re: opaque data types, Ted Zlatanov, 2013/06/09
- Re: opaque data types, Stefan Monnier, 2013/06/07
- Re: opaque data types, Ted Zlatanov, 2013/06/07