For Programmers: Free Programming Magazines  


Home > Archive > Scheme > September 2006 > let has to respect lexical scope as well









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author let has to respect lexical scope as well
Andreas

2006-09-26, 4:09 am

> However, when evaluating a let expression, the environment does
> not have to be remembered in this way. The body of the let expression is
> evaluated in the environment of the let expression.


that body can in turn reference variables in the lexical scope of the
let however, so the
let _does_ have to remember its lexical environment just like a lambda,
i.e.

(let ((x 5))
...
(let ((y 10))
(+ x y)))

if the inner let did not remember its environment, how would it resolve
the free reference to "x" in its body?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com