Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!styx!ames!ucbcad!ucbvax!cartan!brahms!desj From: desj@brahms (David desJardins) Newsgroups: comp.lang.lisp Subject: Re: A small brush fire ... Message-ID: <415@cartan.Berkeley.EDU> Date: Sun, 23-Nov-86 21:47:48 EST Article-I.D.: cartan.415 Posted: Sun Nov 23 21:47:48 1986 Date-Received: Mon, 24-Nov-86 21:02:26 EST References: <8868@duke.duke.UUCP> Sender: daemon@cartan.Berkeley.EDU Reply-To: desj@brahms (David desJardins) Organization: Math Dept. UC Berkeley Lines: 19 In article <8868@duke.duke.UUCP> jds@duke.UUCP (Joseph D. Sloan) asks why good code can require lexical rather than dynamic scoping. (define (addn n) (lambda (x) (+ x n))) (define 2+ (addn 2)) (define 3+ (addn 3)) (2+ 4) gives 6 (lexical) or 7 (dynamic). In general, you need lexical scoping whenever you want bindings of actual to formal parameters to exist beyond the scope of the current evaluation. -- David desJardins P.S. Read Abelson and Sussman.