From: Tim Moore
Subject: Re: (setf (symbol-function)
Date: 
Message-ID: <1993Jun24.095720.13873@hellgate.utah.edu>
> From: ········@Aero.org (David Schulenburg)
> Subject: Re: (setf (symbol-function)
> 

> also, from the dpANS:
> 
> "Defines a new function named function-name in the global environment."
> (p. 5-15)
> 
> from CLTL2:
> 
> "X3J13 voted in March 1989 <50> to clarify that, while defining forms
> normally appear at top level, it is meaningful to place them in
> non-top-level contexts; defun must define the function within the
> enclosing lexical environment, not within the null lexical environment."
> (p. 84)
> 
> these last two quotations seem to be at odds with one another.  isn't
> the dpANS in error here?

No.  The function name is in the global environment, but the function
body is defined within the enclosing lexical environment.  Silly
example:

(let ((c 0))
  (defun counter ()
    (prog1 c
      (incf c))))

DEFUN defines COUNTER in the normal way, as a global function, but C
in the body of COUNTER refers to C in the enclosing environment.

> 
> david
> 
-- 
Tim Moore                    ·····@cs.utah.edu {bellcore,hplabs}!utah-cs!moore
"Wind in my hair - Shifting and drifting - Mechanical music - Adrenaline surge"
	- Rush