[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: testcover: setf-method and treatment of `defcustom'

From: Stefan Monnier
Subject: Re: testcover: setf-method and treatment of `defcustom'
Date: Thu, 13 Sep 2012 09:09:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

>> Does one of the 2 patches work?
> I'd need to compile and install an Emacs 24 version for this to try.

Actually, not just "Emacs 24" but "Emacs trunk" because it uses gv.el
which is new on the trunk.  For older Emacsen, I'd have to use
define-setf-expander which is a pain the rear.

>> 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'.

Indeed, that's not possible with `defsetf' which is macro designed
specifically for setters that do not care about the shape of their
argument, but only about the value they return.

>> 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.

So for (setf (testcover-after IDX PLACE) VAL), we should first read the
value of PLACE, pass it to testcover-after, and then modify PLACE to
have value VAL?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]