From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pierre Lorenzon Newsgroups: gmane.emacs.bugs Subject: bug#20914: eieio/slot/group Date: Wed, 01 Jul 2015 08:35:05 +0200 (CEST) Message-ID: <20150701.083505.514312490268737442.devel@pollock-nageoire.net> References: <20150629.192952.75170699401312078.devel@pollock-nageoire.net> <20150701.060228.1839196597497012994.devel@pollock-nageoire.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435733123 30121 80.91.229.3 (1 Jul 2015 06:45:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2015 06:45:23 +0000 (UTC) Cc: 20914@debbugs.gnu.org To: monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 01 08:45:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZABlh-0004He-EA for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jul 2015 08:45:13 +0200 Original-Received: from localhost ([::1]:49885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZABlg-0000mh-SI for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jul 2015 02:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZABlc-0000lQ-Rl for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 02:45:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZABlX-0005bJ-Q8 for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 02:45:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZABlX-0005Zk-KB for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 02:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZABlW-0002N6-U5 for bug-gnu-emacs@gnu.org; Wed, 01 Jul 2015 02:45:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pierre Lorenzon Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jul 2015 06:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20914 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20914-submit@debbugs.gnu.org id=B20914.14357330819076 (code B ref 20914); Wed, 01 Jul 2015 06:45:02 +0000 Original-Received: (at 20914) by debbugs.gnu.org; 1 Jul 2015 06:44:41 +0000 Original-Received: from localhost ([127.0.0.1]:35068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZABlA-0002MK-Pt for submit@debbugs.gnu.org; Wed, 01 Jul 2015 02:44:41 -0400 Original-Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:28718 helo=smtp.smtpout.orange.fr) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZABl7-0002M6-Qu for 20914@debbugs.gnu.org; Wed, 01 Jul 2015 02:44:39 -0400 Original-Received: from localhost ([86.212.76.37]) by mwinf5d55 with ME id mukW1q00d0oHB8603ukX9u; Wed, 01 Jul 2015 08:44:31 +0200 X-ME-Helo: localhost X-ME-Date: Wed, 01 Jul 2015 08:44:31 +0200 X-ME-IP: 86.212.76.37 In-Reply-To: <20150701.060228.1839196597497012994.devel@pollock-nageoire.net> X-Mailer: Mew version 6.5 on Emacs 25.0.50 / Mule 6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104561 Archived-At: Sorry in fact it works when patching and recompiling the whole stuff.Recompiling only cl-preloaded.el is not enough. Anyway copy-tree should be used and not copy-sequence for the properties. Otherwise properties are not eq but car of them are eq and that's not what we want. Pierre From: Pierre Lorenzon Subject: bug#20914: eieio/slot/group Date: Wed, 01 Jul 2015 06:02:28 +0200 (CEST) > From: Stefan Monnier > Subject: Re: bug#20914: eieio/slot/group > Date: Tue, 30 Jun 2015 14:09:20 -0400 > >>> The problem comes from use of `copy-sequence' in >>> `eieio-copy-parents-into-subclass' function of eieio-core. this >>> copy is not reccursive as explained in code comment but it >>> should be ! There's a joined patch that fixes the bug. >> >> Thanks for the investigation. I think the fix should be > > > Sure it is better to have a true copier for > cl--slot-descriptor. > > >> applied deeper. Can you confirm that the patch below works for you > > unfortunately it does not ! I modified cl-preloaded.el > recompiled it but once restarting emacs my example classes do > not havae suitable properties. When doing Ch f > cl--copy-slot-descriptor I get that it is an alias for > copy-sequence as it was before and not the function defined > by the new definition you gave. Moreover if I force > cl-prelaoded.el to be loaded I get the correct definition. I > suspect that things are not loaded as they should but why > .... > > > > >> as well? >> >> >> Stefan >> >> >> diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el >> index ed0639b..2e9bdde 100644 >> --- a/lisp/emacs-lisp/cl-preloaded.el >> +++ b/lisp/emacs-lisp/cl-preloaded.el >> @@ -195,7 +195,7 @@ >> (:constructor nil) >> (:constructor cl--make-slot-descriptor >> (name &optional initform type props)) >> - (:copier cl--copy-slot-descriptor)) >> + (:copier nil)) >> ;; FIXME: This is actually not used yet, for circularity reasons! >> "Descriptor of structure slot." >> name ;Attribute name (symbol). >> @@ -205,6 +205,11 @@ >> ;; :documentation, :protection, :custom, :label, :group, :printer. >> (props nil :type alist)) >> >> +(defun cl--copy-slot-descriptor (slot) >> + (let ((new (copy-sequence slot))) > > > > Are you sure that a copy-sequence will be enough here ? props > themselves are sequences hence they will be referenced by > this copy-sequence not copied. I think that a copy-tree > should be used here. > > >> + (cl-callf copy-sequence (cl--slot-descriptor-props new)) >> + new)) >> + >> (cl-defstruct (cl--class >> (:constructor nil) >> (:copier nil)) > > Ok I'll try to understand why it does not > work. I'll probably learn something in this > history and that's good ! > > > Pierre > > >