[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Redefining locals
- From: "Aaron Brown" <aaron-lua@...>
- Date: Thu, 11 Nov 2004 14:17:09 -0500
I just ran the following through Guile (the Gnu version of
Scheme) and got "baz".
(let ((foo 'bar))
(define func (lambda ()
foo))
(set! foo 'baz) ;; Alters the foo within func.
(func))
The Lua equivalent (which also gives "baz") is
local foo = "bar"
function func()
return foo
end -- func
foo = "baz" -- Alters the foo within func.
print(func())
Guile is the only lexically scoped Lisp I have access to
from my current location, but my understanding is that any
modern lexically scoped Lisp would work the same way.
--
Aaron