From: Matthew X. Economou
Subject: Correct use of special variables?
Date: 
Message-ID: <w4o7kufuu5u.fsf@eco-wks5.cinci.irtnog.org>
The macro WITH-COMPILATION-UNIT has me somewhat confused by it's use
of the term "dynamic environment".  Would the following implementation
of this particular macro be approximately correct in how it creates
the dynamic environment (which seems like it could be merely a list of
CONDITION objects to be thrown upon exit of the compilation unit)?

(defstruct compilation-unit
  (deferred-warnings nil :type list))

(defparameter *compilation-unit* nil)

(defmacro with-compilation-unit ((&key (override nil) &allow-other-keys) &body forms)
  `(if (or (null *compilation-unit*) ,override)
       (let ((*compilation-unit* (make-compilation-unit)))
	 (declare (special *compilation-unit*))
	 ,@forms)
     (progn ,@forms)))

-- 
"His power lies apparently in his ability to choose incompetent
enemies." - Crow T. Robot, MST3K, "Prince of Space"

From: Barry Margolin
Subject: Re: Correct use of special variables?
Date: 
Message-ID: <Eu3u7.8$pY2.2657@burlma1-snr2>
In article <···············@eco-wks5.cinci.irtnog.org>,
Matthew X. Economou <········@irtnog.org> wrote:
>The macro WITH-COMPILATION-UNIT has me somewhat confused by it's use
>of the term "dynamic environment".  Would the following implementation
>of this particular macro be approximately correct in how it creates
>the dynamic environment (which seems like it could be merely a list of
>CONDITION objects to be thrown upon exit of the compilation unit)?
>
>(defstruct compilation-unit
>  (deferred-warnings nil :type list))
>
>(defparameter *compilation-unit* nil)
>
>(defmacro with-compilation-unit ((&key (override nil) &allow-other-keys)
>&body forms)
>  `(if (or (null *compilation-unit*) ,override)
>       (let ((*compilation-unit* (make-compilation-unit)))
>	 (declare (special *compilation-unit*))
>	 ,@forms)
>     (progn ,@forms)))

Since DEFPARAMETER declares the variable special, you don't need the
DECLARE form in the macro.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Matthew X. Economou
Subject: Re: Correct use of special variables?
Date: 
Message-ID: <w4o669yvkm1.fsf@eco-wks5.cinci.irtnog.org>
>>>>> "Barry" == Barry Margolin <······@genuity.net> writes:

    Barry> Since DEFPARAMETER declares the variable special, you don't
    Barry> need the DECLARE form in the macro.

Thanks.

-- 
"His power lies apparently in his ability to choose incompetent
enemies." - Crow T. Robot, MST3K, "Prince of Space"
From: Kent M Pitman
Subject: Re: Correct use of special variables?
Date: 
Message-ID: <sfwu1xjrlnq.fsf@world.std.com>
Barry Margolin <······@genuity.net> writes:

> In article <···············@eco-wks5.cinci.irtnog.org>,
> Matthew X. Economou <········@irtnog.org> wrote:
> >The macro WITH-COMPILATION-UNIT has me somewhat confused by it's use
> >of the term "dynamic environment".  Would the following implementation
> >of this particular macro be approximately correct in how it creates
> >the dynamic environment (which seems like it could be merely a list of
> >CONDITION objects to be thrown upon exit of the compilation unit)?
> >
> >(defstruct compilation-unit
> >  (deferred-warnings nil :type list))
> >
> >(defparameter *compilation-unit* nil)
> >
> >(defmacro with-compilation-unit ((&key (override nil) &allow-other-keys)
> >&body forms)
> >  `(if (or (null *compilation-unit*) ,override)
> >       (let ((*compilation-unit* (make-compilation-unit)))
> >	 (declare (special *compilation-unit*))
> >	 ,@forms)
> >     (progn ,@forms)))
> 
> Since DEFPARAMETER declares the variable special, you don't need the
> DECLARE form in the macro.

But ignoring that, yes, this is basically what it's doing.