Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!think!leander.think.com!barmar From: barmar@leander.think.com (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Linking and MACL (really efficiency of local functions) Message-ID: <31762@news.Think.COM> Date: 22 Nov 89 21:44:33 GMT References: <21316@brunix.UUCP> <1989Nov20.150510.20700@hellgate.utah.edu> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA Lines: 30 In article lou@atanasoff.rutgers.edu (Lou Steinberg) writes: >There is another issue with LABELS and FLET: interactive programming >environments for LISP (at least the ones I am familiar with) do not >have good ways to handle local functions. E.g. to trace a function, >you must give the function name, and what gets traced is the global >function definition. There is no way to even specify that you want >tracing for a local definition. There are similar problems with >anonymous functions, e.g. closures produced with FUNCTION. Both Common Lisp implementations I'm familiar with -- Symbolics and Lucid -- have names for local functions. They are named (:INTERNAL ), where is the name of the function containing the local definition, is an index used to distinguish multiple local functions in the same parent, and is an optional name produced when FLET, LABELS, or SYS:NAMED-LAMBDA are used (anonymous local functions are just named (:INTERNAL ). You can pass these names to TRACE, DISASSEMBLE, etc. You are right that development environments don't deal with local functions as well as with top-level functions. For instance, control-shift-A in Zmacs, which is supposed to show the argument list of the function in the form surrounding the cursor, doesn't recognize local function names (of course, if you follow the age-old guideline of keeping your function definitions within a screenful in size, you should only need to look up a few lines to find this information). Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar