From: ···········@gmail.com
Subject: get-setf-method
Date: 
Message-ID: <4d7345b0-c198-443e-9dc1-a20e4a7323c5@a1g2000hsb.googlegroups.com>
I'm trying to write a local macro with MACROLET that is supposed to do
basically something that (I'll save the details), if I were to write a
global macro, then the appropriate choice would be the straightforward
DEFINE-MODIFY-MACRO. But of course I can't use the latter in this
case, so could I possibly achieve the same effect by taking advantage
of GET-SETF-METHOD? In other words, when you can't use DEFINE-MODIFY-
MACRO, is writing a macro that uses GET-SETF-METHOD the right path to
follow?

From: ···········@gmail.com
Subject: Re: get-setf-method
Date: 
Message-ID: <3f3a6170-161a-4107-ad61-f5d42edad48f@i76g2000hsf.googlegroups.com>
On May 24, 5:22 pm, ···········@gmail.com wrote:
> I'm trying to write a local macro with MACROLET that is supposed to do
> basically something that (I'll save the details), if I were to write a
> global macro, then the appropriate choice would be the straightforward
> DEFINE-MODIFY-MACRO. But of course I can't use the latter in this
> case, so could I possibly achieve the same effect by taking advantage
> of GET-SETF-METHOD? In other words, when you can't use DEFINE-MODIFY-
> MACRO, is writing a macro that uses GET-SETF-METHOD the right path to
> follow?

OOPS ... actually I meant GET-SETF-EXPANSION. Sorry about that :)
From: Willem Broekema
Subject: Re: get-setf-method
Date: 
Message-ID: <60a83b32-fc82-49cb-8a69-1b969be66f6c@x41g2000hsb.googlegroups.com>
On May 24, 5:22 pm, ···········@gmail.com wrote:
> I'm trying to write a local macro with MACROLET that is supposed to do
> basically something that (I'll save the details), if I were to write a
> global macro, then the appropriate choice would be the straightforward
> DEFINE-MODIFY-MACRO. But of course I can't use the latter in this
> case,

Please tell more about your case. Why won't define-modify-macro work?
The solution you are going for does what you ask for, but is a bit
hairy. There might be easier, higher-level ways to solve whatever
issue you are having.

> In other words, when you can't use DEFINE-MODIFY-MACRO,
> is writing a macro that uses GET-SETF-METHOD the right path to
> follow?

> OOPS ... actually I meant GET-SETF-EXPANSION. Sorry about that :)

It is possible, as define-modify-macro is a macro built on top of get-
setf-expansion. The expansion of define-modify-macro includes a
defmacro form. You can look up the definition of define-modify-macro
in your implementation or take a portable version, and write your own
let-modify-macro macro analogue to it, except that yours expands into
macrolet instead of defmacro.

- Willem
From: ···········@gmail.com
Subject: Re: get-setf-method
Date: 
Message-ID: <5061a01b-645a-4b71-9590-70aebd624d3f@56g2000hsm.googlegroups.com>
On 25 Mag, 10:23, Willem Broekema <········@gmail.com> wrote:
> On May 24, 5:22 pm, ···········@gmail.com wrote:
>
> > I'm trying to write a local macro with MACROLET that is supposed to do
> > basically something that (I'll save the details), if I were to write a
> > global macro, then the appropriate choice would be the straightforward
> > DEFINE-MODIFY-MACRO. But of course I can't use the latter in this
> > case,
>
> Please tell more about your case. Why won't define-modify-macro work?
> The solution you are going for does what you ask for, but is a bit
> hairy. There might be easier, higher-level ways to solve whatever
> issue you are having.
>
> > In other words, when you can't use DEFINE-MODIFY-MACRO,
> > is writing a macro that uses GET-SETF-METHOD the right path to
> > follow?
> > OOPS ... actually I meant GET-SETF-EXPANSION. Sorry about that :)
>
> It is possible, as define-modify-macro is a macro built on top of get-
> setf-expansion. The expansion of define-modify-macro includes a
> defmacro form. You can look up the definition of define-modify-macro
> in your implementation or take a portable version, and write your own
> let-modify-macro macro analogue to it, except that yours expands into
> macrolet instead of defmacro.
>
> - Willem

OK. Thanks Willem.