[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: |
Wed, 05 Jun 2013 10:53:00 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
On Wed, 05 Jun 2013 03:01:47 +0400 Dmitry Gutov <address@hidden> wrote:
DG> On 05.06.2013 2:44, Daniel Hackney wrote:
>> The big problem with `cl-defstruct' in this case is its lack of
>> extensibility. We are going to want to add additional slots to
>> `package-desc' structures over time, but doing so would require
>> redefining `package-desc' each time. `cl-defstruct' requires that
>> structures be of the exact length given in the definition of the
>> structure
DG> I haven't had the time to read your patch properly yet, but I don't
DG> think that's necessarily true. Just like I did in my current patch for
DG> #13291, one of the fields in the struct can contain an alist with all
DG> extra properties.
I agree with Dmitry. Keep the top-level structure static with
`cl-defstruct' and just add an option field that holds a plist. That
provides a good data API, while a pure-plist approach is inherently less
stable as an API.
I worked with plist-only data structures in auth-source.el and looking
back, wish I had used the approach suggested by Dmitry and kept plists
to just one corner of the data structure. Emacs Lisp doesn't have
(AFAIK) good plist support and self-quoting symbols have some issues
too, so you may end up converting 'X to :X and back occasionally. That
was just my experience and I may have simply used plists badly.
To address all this I used some `loop' tricks... it seemed like a good
idea at the time :)
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 <=
- 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, 2013/06/06
- 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