Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!ephemeral.ai.toronto.edu!bradb From: bradb@ai.utoronto.ca Newsgroups: comp.lang.lisp Subject: Simple question RE nested DEFUNs Message-ID: <89Jul31.114325edt.11243@ephemeral.ai.toronto.edu> Date: 31 Jul 89 15:44:12 GMT Expires: Aug 31 1989 Reply-To: bradb@ai.utoronto.ca Followup-To: comp.lang.lisp Organization: Department of Computer Science, University of Toronto Lines: 25 I come from a Scheme background, where I'm used to defining helping functions within the body of the function being helped, as in (define (foo a) (define (bar b) (... do some stuff with b and return result ...)) (... do some stuff with a and call bar as a ...) (... helping function ...)) Now, when I do this in CommonLisp, I notice that the inner DEFUN (the one for bar in my example) is actually being re-defined on every invocation of foo. Eek, this is not what I wanted! I wanted the function to be defined exactly once, before foo is ever called, but available only within the scope of the definition of foo. I'm sure there is a proper way to do this in CommonLisp, but I'm not sure what it is. Could some kind soul please enlighten me? Thanks very much in advance, (-: Brad Brown :-) bradb@ai.utoronto.ca (I knew there was a reason I liked Scheme and all it's simplicity...)