Newsgroups: comp.lang.scheme,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!news.dfci.harvard.edu!camelot.ccs.neu.edu!chaos.dac.neu.edu!usenet.eel.ufl.edu!gatech!howland.reston.ans.net!tank.news.pipex.net!pipex!uknet!liv!news
From: bruce@liverpool.ac.uk
Subject: Re: Confused over Scheme Pedagogy of mutation procedures
In-Reply-To: richter@banach.math.purdue.edu's message of 19 Jul 1995 23:51:40 GMT
Message-ID: <BRUCE.95Jul21114614@iasc3.scm.liv.ac.uk>
Sender: news@liverpool.ac.uk (News System)
Nntp-Posting-Host: iasc3.scm.liv.ac.uk
Organization: IASC, University of Liverpool
References: <RICHTER.95Jul19084033@banach.math.purdue.edu>
	<pch-1907951304510001@m142.mystech.com> <3uk5qc$ol6@mozo.cc.purdue.edu>
Date: Fri, 21 Jul 1995 10:46:14 GMT
Lines: 22
Xref: glinda.oz.cs.cmu.edu comp.lang.scheme:13300 comp.lang.lisp:18376

>>>>> "Bill" == Bill Richter <richter@banach.math.purdue.edu> writes:

>> (defun ... 
>>     (let ((balance ..))
>>         (lambda (...) ...)))

> I don't understand this; Will also said this.  Seems to me that
> dynamic scoping is even better for this purpose.  The point of
> lexical scoping is that the variable `balance' which is bound
> essentially in the frame above can be modified in our frame.
> Dynamic scoping would mean to me that anyone anywhere can modify
> `balance'...

That's true, but the `balance' that they'll modify could be any
`balance'; it would depend on who called them.  Lexical closure means
that you know which balance it's going to be: it's going to be the one
created by let.
-- 
Bruce                   Institute of Advanced Scientific Computation
bruce@liverpool.ac.uk   University of Liverpool
http://supr.scm.liv.ac.uk/~bruce/

