One thing that helped me grok a little better lexical vs dynamic scope  is to make a crude but perhaps useful comparison to C++:<br><br><br>lexical scope  <-->  tracing C++ method calls on non-virtual methods. You can tell trace the flow of control on paper beforehand; and know what's going to happen before running it, always.<br>
<br><br>dynamic scope <--> C++ virtual method invocation.  You don't know until runtime which code (or variable value in the case of dynamic variables) are being talked about, because method dispatch (and variable access in the case of dynamic variables) depends on runtime current state.<br>
<br><br>I think dynamic variables (which are available in Common Lisp but not in most Schemes, if I understand right) and dynamic scoping are broader in application (a superset of) the facilities provided by C++ virtual methods, but it's the nearest thing in a language that you more likely familiar with.<br>
<br><br>Does that help?<br><br>Experts, feel free to improve on this comparison.<br><br>- Jason<br><br><br><div class="gmail_quote">On Mon, Sep 5, 2011 at 9:51 AM, Raffael Cavallaro <span dir="ltr"><<a href="mailto:raffaelcavallaro@mac.com">raffaelcavallaro@mac.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
On Sep 5, 2011, at 10:02 AM, Steve Graham wrote:<br>
<br>
> Can someone help?<br>
<br>
Marc's reply is, of course, succinct and correct.<br>
<br>
If you want a fuller understanding of scope, I've found the wikipedia article to be relatively clear and to the point:<br>
<<a href="http://en.wikipedia.org/wiki/Scope_%28computer_science%29" target="_blank">http://en.wikipedia.org/wiki/Scope_(computer_science)</a>><br>
<br>
It covers both lexical (a.k.a. "static") scope, and dynamic scope, and gives examples.<br>
<br>
hth<br>
<br>
warmest regards,<br>
<br>
Ralph<br>
<font color="#888888"><br>
<br>
Raffael Cavallaro<br>
<a href="mailto:raffaelcavallaro@me.com">raffaelcavallaro@me.com</a><br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br>