Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!swrinde!ucsd!helios.ee.lbl.gov!pasteur!bansai.uucp!norvig From: norvig@bansai.uucp (Peter Norvig) Newsgroups: comp.lang.lisp Subject: Downward Funargs no longer anonymous? Keywords: funarg, dynamic-extent Message-ID: <26081@pasteur.Berkeley.EDU> Date: 11 Jul 90 17:04:25 GMT Sender: news@pasteur.Berkeley.EDU Reply-To: norvig@bansai.uucp (Peter Norvig) Distribution: usa Organization: University of California at Berkeley Lines: 26 X-Local-Date: 11 Jul 90 10:04:25 PDT In several LISPM implementations, we have been able to declare: #'(lambda (x) (declare (sys:downward-function)) (f x y)) to indicate that even though the lambda expression captures the variable y from the environment, it will only be used by functions below, and hence can be stack-allocated, without copying the enviornment. In CLtL2, the declaration DYNAMIC-EXTENT has been added, ostensibly to cover this and other cases. Unfortunately, this means we can no longer use anonymous lambda expressions. I have to say instead: (flet ((f (lambda (x) (declare (dynamic-extent f)) (f x y)))) ... #'f ... ) where the "..." indicate the surrounding environment. Thus, the dynamic-extent declaration does not seem to do the job of sys:downward-function very well. Was this problem discussed when dynamic-extent was adopted?