home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!caen!sdd.hp.com!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.lang.lisp
- Subject: Re: Advice on recursion?
- Date: 23 Jul 1992 23:23:18 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 18
- Message-ID: <14nf16INN7m0@early-bird.think.com>
- References: <1992Jul23.192749.129@cerberus.ulaval.ca>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <1992Jul23.192749.129@cerberus.ulaval.ca> vachon@chicoutimi.gel.ulaval.ca (Pierre Vachon) writes:
- > Are there disadvantages to using 'labels' like this:
- > (defun foo (arg)
- > (let ((...))
- > (labels ((recursive (arg1 arg2)
- > (body)))
- > (recursive 'foo 'bar))))
-
- That's precisely what LABELS is for: defining recursive or
- mutually-callable local functions. Presumably the body references ARG
- and/or the variables bound by the LET, which is why you don't want to use a
- global function definition (you would have to pass them as additional
- arguments in that case).
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-