From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: No cl-lib replacement for define-modify-macro? Date: Tue, 06 Nov 2012 13:03:10 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352225019 17533 80.91.229.3 (6 Nov 2012 18:03:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2012 18:03:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 06 19:03:49 2012 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 1TVnV6-0000c4-Qd for ged-emacs-devel@m.gmane.org; Tue, 06 Nov 2012 19:03:48 +0100 Original-Received: from localhost ([::1]:47440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVnUx-0006La-TZ for ged-emacs-devel@m.gmane.org; Tue, 06 Nov 2012 13:03:39 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVnUq-0006KC-Tt for emacs-devel@gnu.org; Tue, 06 Nov 2012 13:03:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVnUg-0008U3-IJ for emacs-devel@gnu.org; Tue, 06 Nov 2012 13:03:32 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:42775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVnUa-0008Nv-9N; Tue, 06 Nov 2012 13:03:17 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id qA6I3AMw018149; Tue, 6 Nov 2012 13:03:10 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 8C004B4278; Tue, 6 Nov 2012 13:03:10 -0500 (EST) In-Reply-To: (Glenn Morris's message of "Tue, 06 Nov 2012 11:53:03 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4394=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4394> : streams <852902> : uri <1261662> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:154704 Archived-At: >> The replacement is gv-letplace. > How do I write: > (define-modify-macro incf (&optional (n 1)) +) > using gv-letplace? (Forget about the "&optional" bit if necessary.) Guaranteed 100% untested: (defmacro incf (place &optional n) (gv-letplace (getter setter) place (macroexp-let2 nil v (or n 1) (funcall setter `(+ ,v ,getter))))) -- Stefan