[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: local variables and scope
- From: Olivier Mascia <om-lists@...>
- Date: Thu, 25 Aug 2005 10:25:48 +0200
In the second incarnation of this battle I came in swinging for the
"locals-by-default" corps and was quickly converted to the other camp
with this single missive:
Thank you very much. This is exactly my question and the answer and I
... Proper lexical scoping really requires that you have a choice
between mutating a binding (assignment) and creating a new
binding (declaration). Alas, the 'local by default' rule mixes
them and makes an assignment do both. Consequently you cannot
modify a variable in an outer scope with a simple assignment
(because that would create a new local variable with the same
This closes the question and this thread for me.
Thanks again for this pointer.
(I wish it really be put in evidence in some FAQ and certainly in Second
Edition of the Book).