From: Vladimir Zolotykh
Subject: WITH-CONTEXT macro
Date: 
Message-ID: <opspfodeuu4w83rv@algow.eurocom.od.ua>
Hi

Would you mind explaining (or just showing) me the technique for the
following:

I'd like to have two macros

   WITH-MY-CONTEXT
   CONTEXT-RELATED-ACTION

The second macro should be valid only inside the first one. The
WITH-MY-CONTEXT macro provides some context, calculates some variables
for example and the CONTEXT-RELATED-ACTION uses these variables to do
its job faster (it might be called many times). Is something similar
used? Or may be different but aimed the same technique exists?

Any short example of the above behavior would suffice.

Thanks in advance


-- 
Vladimir Zolotykh
From: Sam Steingold
Subject: Re: WITH-CONTEXT macro
Date: 
Message-ID: <uy8bgf5us.fsf@gnu.org>
> * Vladimir Zolotykh <······@rhebpbz.bq.hn> [2005-04-18 18:09:04 +0300]:
>
>    WITH-MY-CONTEXT
>    CONTEXT-RELATED-ACTION
>
> The second macro should be valid only inside the first one.

WITH-MY-CONTEXT should expand to MACROLET
(http://www.lisp.org/HyperSpec/Body/speope_fletcm_scm_macrolet.html)
which defines CONTEXT-RELATED-ACTION

if you wish, you can also have a global definition of
CONTEXT-RELATED-ACTION which expands to an appropriate ERROR call (e.g.,
SOURCE-PROGRAM-ERROR)

See any LOOP-FINISH implementation.


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://pmw.org.il/> <http://www.memri.org/>
<http://www.dhimmi.com/> <http://www.palestinefacts.org/>
Bus error -- driver executed.