From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel 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 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87zjv41uer.fsf@lifelogs.com> References: <51AE71DB.8060005@yandex.ru> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370444004 24760 80.91.229.3 (5 Jun 2013 14:53:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Jun 2013 14:53:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 05 16:53:24 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UkF5T-0003dG-5U for ged-emacs-devel@m.gmane.org; Wed, 05 Jun 2013 16:53:19 +0200 Original-Received: from localhost ([::1]:50568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkF5S-0002OM-SK for ged-emacs-devel@m.gmane.org; Wed, 05 Jun 2013 10:53:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkF5P-0002O1-Vd for emacs-devel@gnu.org; Wed, 05 Jun 2013 10:53:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkF5O-0001lS-Im for emacs-devel@gnu.org; Wed, 05 Jun 2013 10:53:15 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkF5O-0001lC-Cc for emacs-devel@gnu.org; Wed, 05 Jun 2013 10:53:14 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UkF5J-0003TU-NH for emacs-devel@gnu.org; Wed, 05 Jun 2013 16:53:09 +0200 Original-Received: from pool-72-93-26-80.bstnma.east.verizon.net ([72.93.26.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jun 2013 16:53:09 +0200 Original-Received: from tzz by pool-72-93-26-80.bstnma.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jun 2013 16:53:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-72-93-26-80.bstnma.east.verizon.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:p6FQ8MHFsG6nGv/GpGNtFepvGSA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160108 Archived-At: On Wed, 05 Jun 2013 03:01:47 +0400 Dmitry Gutov 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