From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Merten Newsgroups: gmane.emacs.devel Subject: Re: testcover: setf-method and treatment of `defcustom' Date: Wed, 12 Sep 2012 22:38:28 +0200 Message-ID: <7050.1347482308@theowa.merten-home.homelinux.org> References: <6900.1347261102@theowa.merten-home.homelinux.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1347482330 1777 80.91.229.3 (12 Sep 2012 20:38:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2012 20:38:50 +0000 (UTC) Cc: Jonathan Yavner To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 12 22:38:53 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 1TBthu-0005pE-16 for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2012 22:38:46 +0200 Original-Received: from localhost ([::1]:42853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBthq-0005zm-Bn for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2012 16:38:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBthn-0005zV-FK for emacs-devel@gnu.org; Wed, 12 Sep 2012 16:38:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBthm-00078f-AD for emacs-devel@gnu.org; Wed, 12 Sep 2012 16:38:39 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:65289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBthl-00076h-Tt for emacs-devel@gnu.org; Wed, 12 Sep 2012 16:38:38 -0400 Original-Received: from theowa.merten-home.homelinux.org (ip-109-41-78-61.web.vodafone.de [109.41.78.61]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MLyRQ-1TAnFA2GKK-007hS3; Wed, 12 Sep 2012 22:38:36 +0200 Original-Received: by theowa.merten-home.homelinux.org (Postfix, from userid 1000) id 9EAEA400C7; Wed, 12 Sep 2012 22:38:28 +0200 (CEST) Original-Received: from theowa.merten-home.homelinux.org (localhost [127.0.0.1]) by theowa.merten-home.homelinux.org (Postfix) with ESMTP id 9BF827A00C; Wed, 12 Sep 2012 22:38:28 +0200 (CEST) In-reply-to: Comments: In-reply-to Stefan Monnier message dated "Mon, 10 Sep 2012 23:40:11 -0400." X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.1.1 X-Provags-ID: V02:K0:tY8xVy4QYH3XjfZ7dDu3WL8OOxCImDP/hoHLdJy7ksq /wCVkh2nbzErd0o31tZavwUnOUiiXV1aMyECFdHlB1NB8CJXra vXTnE9YC7C+cZ9vaFtX4ifuyWXHUQzC9aEpP1aGlw8ZFwlKtCx wSgEuBFf3iiGkSw7amo8H3rrJ1bEdNKsyNAscnFiD64WTQ5C6Q Wi878ohYZ4wtcHy28hZukaWNubRx06eRdhIuvZKP7brwuGGBte vyluPBp7VNRREh80gnzVLvbJG0J+q9MtlkDo+yWS21Ecx8Mx3m N1kuaccCdUkU8dG3rvnfmUBtpsAysMPmX9ZAfYacTOoOuIHl/T 16AIR8VdkhvwNcjSQtdS2g3SSc2I3iMpDPL5UovLwI//9XHSMO uYsw8NrnlOSibQuIjZAlXIlJQcIeDxArWc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.186 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:153259 Archived-At: --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Stefan and Jonathan! Yesterday Stefan Monnier wrote: >> No setf-method known for testcover-after >=20 > Does one of the 2 patches work? I'd need to compile and install an Emacs 24 version for this to try. Frankly so far I didn't do so. I'll give it a try. >> I looked into this and found `defsetf' in `cl-macs'. `testcover-after' >> is a function which has only some side effect. I think >> (defsetf testcover-after (idx val) (store) >> (list 'progn >> (list 'testcover-after idx val) >> (list 'setf val store))) >> does the right thing. At least the error messages described above >> vanish for me. >=20 > I'm not sure what we should do, but the above doesn't sound quite right. This may well be. I do not fully understand what I'm doing there ;-) . >> AFAICS the only thing which can go wrong with this setf-method seems >> to be the double evaluation of `val' >=20 > In (setf (testcover-after IDX (aref A I)) V), your defsetf will be > called with a `val' that's a temporary variable bound to the value of > (aref A I), so double evaluation is not a problem. Ok. > But your `(setf ,val > ,store) will end up changing some temporary variable rather than > changing the I'th slot of the A vector. Oops. My intention with ",val" was to expand the original form before binding it to val into this place so `setf' treats the original form. May be that's not possible with `defsetf'. > My 1st patch has the downside that it doesn't call testcover-after at all. > The reason is that I don't know what VAL to set in IDX when we do > things like (push VAL (testcover-after IDX PLACE)): should it be the > value read before pushing VAL onto it, or the value set afterwards? My cent: Before pushing VAL. AFAICS `testcover-after' needs to see PLACE unmodified. Gr=FC=DFe Stefan --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQCVAwUBUFDywQnTZgC3zSk5AQLHwQP/VEZN5ty7fI6soorx6S3FPPpFg3LuPbTw UWDwjTFfVfUZftbS/CNdN9FtmDhoP1Gfixm5DsEtTPDLnw1Ttz+kZD+B057Rhqip xLVY/flKaTm3tk15ZZH4y5pHCxu1rrzAcmqdDblaVeVX8Xebs6B+gpprb3/NKdN/ PQc/RI6nPBQ= =JHSR -----END PGP SIGNATURE----- --=-=-=--