From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 17 21:18:29 2012 Received: (at submit) by debbugs.gnu.org; 18 Jul 2012 01:18:29 +0000 Received: from localhost ([127.0.0.1]:47017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrIuK-0005ff-PQ for submit@debbugs.gnu.org; Tue, 17 Jul 2012 21:18:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44640) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrIuI-0005fY-RG for submit@debbugs.gnu.org; Tue, 17 Jul 2012 21:18:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrIoQ-0008EH-Mf for submit@debbugs.gnu.org; Tue, 17 Jul 2012 21:12:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:40222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrIoQ-0008EB-Ji for submit@debbugs.gnu.org; Tue, 17 Jul 2012 21:12:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrIoP-0000oq-OC for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 21:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrIoO-0008Ds-L9 for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 21:12:21 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:36820) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SrIoO-0008Do-DW for bug-gnu-emacs@gnu.org; Tue, 17 Jul 2012 21:12:20 -0400 Received: (qmail invoked by alias); 18 Jul 2012 01:12:14 -0000 Received: from c-174-56-50-60.hsd1.nm.comcast.net (EHLO bagel) [174.56.50.60] by mail.gmx.com (mp-us003) with SMTP; 17 Jul 2012 21:12:14 -0400 X-Authenticated: #67821228 X-Provags-ID: V01U2FsdGVkX1/eH/g7pW7eOxiTGkYtFhdWs5vo8OcpuS7enGWuEI e9eSN/JgknuX2Q From: Eric Schulte To: bug-gnu-emacs@gnu.org Subject: EIEIO accessors no longer work with setf in Emacs HEAD Date: Tue, 17 Jul 2012 19:11:35 -0600 Message-ID: <878vehdgag.fsf@gmx.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) The following example demonstrates this problem. ;; -*- emacs-lisp -*- (require 'eieio) (defclass foo nil ((bar :initarg :bar :accessor bar :initform nil))) (setf *foo* (make-instance foo :bar :baz)) (bar *foo*) ;; => :baz (setf (bar *foo*) :quz) ;; => (error "(bar *foo*) is not a valid place expression") This works in Emacs 24, and (I believe) should still work. Best, -- Eric Schulte http://cs.unm.edu/~eschulte From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 18 03:26:40 2012 Received: (at 11970) by debbugs.gnu.org; 18 Jul 2012 07:26:40 +0000 Received: from localhost ([127.0.0.1]:47289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrOec-0005ZQ-Ui for submit@debbugs.gnu.org; Wed, 18 Jul 2012 03:26:39 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:60588) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrOea-0005ZJ-9l for 11970@debbugs.gnu.org; Wed, 18 Jul 2012 03:26:37 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q6I7KSeH016940; Wed, 18 Jul 2012 03:20:29 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 37712AE59B; Wed, 18 Jul 2012 03:20:26 -0400 (EDT) From: Stefan Monnier To: Eric Schulte Subject: Re: bug#11970: EIEIO accessors no longer work with setf in Emacs HEAD Message-ID: References: <878vehdgag.fsf@gmx.com> Date: Wed, 18 Jul 2012 03:20:26 -0400 In-Reply-To: <878vehdgag.fsf@gmx.com> (Eric Schulte's message of "Tue, 17 Jul 2012 19:11:35 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4282=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4282> : streams <786532> : uri <1168250> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 11970 Cc: 11970@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > (defclass foo nil > ((bar :initarg :bar :accessor bar :initform nil))) [...] > (setf (bar *foo*) :quz) > ;; => (error "(bar *foo*) is not a valid place expression") Indeed, I had not noticed that eieio.el relied on cl-macs.el's internals for these. Should be fixed now, thank you. Stefan === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-18 05:44:36 +0000 +++ lisp/ChangeLog 2012-07-18 07:18:25 +0000 @@ -1,3 +1,8 @@ +2012-07-18 Stefan Monnier + + * emacs-lisp/eieio.el: Adapt further to gv.el (bug#11970). + (eieio-defclass): Use gv-define-setter when possible. + 2012-07-18 Dmitry Antipov Reflect recent changes in Fgarbage_collect. === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2012-07-13 07:06:09 +0000 +++ lisp/emacs-lisp/eieio.el 2012-07-18 07:10:56 +0000 @@ -44,8 +44,7 @@ ;;; Code: -(eval-when-compile - (require 'cl)) +(eval-when-compile (require 'cl)) ;FIXME: Use cl-lib! (defvar eieio-version "1.3" "Current version of EIEIO.") @@ -431,10 +430,10 @@ (run-hooks 'eieio-hook) (setq eieio-hook nil) - (if (not (symbolp cname)) (signal 'wrong-type-argument '(symbolp cname))) - (if (not (listp superclasses)) (signal 'wrong-type-argument '(listp superclasses))) + (if (not (listp superclasses)) + (signal 'wrong-type-argument '(listp superclasses))) - (let* ((pname (if superclasses superclasses nil)) + (let* ((pname superclasses) (newc (make-vector class-num-slots nil)) (oldc (when (class-p cname) (class-v cname))) (groups nil) ;; list of groups id'd from slots @@ -553,8 +552,8 @@ (put cname 'cl-deftype-handler (list 'lambda () `(list 'satisfies (quote ,csym))))) - ;; before adding new slots, let's add all the methods and classes - ;; in from the parent class + ;; Before adding new slots, let's add all the methods and classes + ;; in from the parent class. (eieio-copy-parents-into-subclass newc superclasses) ;; Store the new class vector definition into the symbol. We need to @@ -652,9 +651,9 @@ ;; We need to id the group, and store them in a group list attribute. (mapc (lambda (cg) (add-to-list 'groups cg)) customg) - ;; anyone can have an accessor function. This creates a function + ;; Anyone can have an accessor function. This creates a function ;; of the specified name, and also performs a `defsetf' if applicable - ;; so that users can `setf' the space returned by this function + ;; so that users can `setf' the space returned by this function. (if acces (progn (eieio--defmethod @@ -668,6 +667,13 @@ ;; Else - Some error? nil? nil))) + (if (fboundp 'gv-define-setter) + ;; FIXME: We should move more of eieio-defclass into the + ;; defclass macro so we don't have to use `eval' and require + ;; `gv' at run-time. + (eval `(gv-define-setter ,acces (eieio--store eieio--object) + (list 'eieio-oset eieio--object '',name + eieio--store))) ;; Provide a setf method. It would be cleaner to use ;; defsetf, but that would require CL at runtime. (put acces 'setf-method @@ -678,8 +684,9 @@ (list --widget-sym--) (list widget) (list --store-sym--) - (list 'eieio-oset --widget-sym-- '',name --store-sym--) - (list 'getfoo --widget-sym--))))))) + (list 'eieio-oset --widget-sym-- '',name + --store-sym--) + (list 'getfoo --widget-sym--)))))))) ;; If a writer is defined, then create a generic method of that ;; name whose purpose is to set the value of the slot. @@ -702,7 +709,8 @@ ) (setq slots (cdr slots))) - ;; Now that everything has been loaded up, all our lists are backwards! Fix that up now. + ;; Now that everything has been loaded up, all our lists are backwards! + ;; Fix that up now. (aset newc class-public-a (nreverse (aref newc class-public-a))) (aset newc class-public-d (nreverse (aref newc class-public-d))) (aset newc class-public-doc (nreverse (aref newc class-public-doc))) @@ -2544,11 +2552,14 @@ ;; (defsetf eieio-oref eieio-oset) -;; FIXME: Not needed for Emacs>=24.2 since setf follows function aliases. + +(if (eval-when-compile (fboundp 'gv-define-expander)) + ;; Not needed for Emacs>=24.2 since gv.el's setf expands macros and + ;; follows aliases. + nil (defsetf slot-value eieio-oset) ;; The below setf method was written by Arnd Kohrs -;; FIXME: Not needed for Emacs>=24.2 since setf expands macros. (define-setf-method oref (obj slot) (with-no-warnings (require 'cl) @@ -2560,7 +2571,7 @@ (list store-temp) (list 'set-slot-value obj-temp slot-temp store-temp) - (list 'slot-value obj-temp slot-temp))))) + (list 'slot-value obj-temp slot-temp)))))) ;;; From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 18 03:34:47 2012 Received: (at control) by debbugs.gnu.org; 18 Jul 2012 07:34:47 +0000 Received: from localhost ([127.0.0.1]:47301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrOmV-0006ci-8t for submit@debbugs.gnu.org; Wed, 18 Jul 2012 03:34:47 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:40788) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SrOmS-0006cb-Tg for control@debbugs.gnu.org; Wed, 18 Jul 2012 03:34:45 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q6I7ScSp017059; Wed, 18 Jul 2012 03:28:39 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 77D8EAE59B; Wed, 18 Jul 2012 03:28:38 -0400 (EDT) From: Stefan Monnier To: control@debbugs.gnu.org Subject: Re: bug#11970: EIEIO accessors no longer work with setf in Emacs HEAD Message-ID: References: <878vehdgag.fsf@gmx.com> Date: Wed, 18 Jul 2012 03:28:38 -0400 In-Reply-To: <878vehdgag.fsf@gmx.com> (Eric Schulte's message of "Tue, 17 Jul 2012 19:11:35 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4282=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4282> : streams <786537> : uri <1168256> X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) close 11970 thanks From unknown Sat Aug 16 13:47:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 15 Aug 2012 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator