[gambit-list] Lexical scope

Jason E. Aten j.e.aten at gmail.com
Mon Sep 5 15:39:40 EDT 2011


I think a dynamic variable is more like a global variable but with a stack
of values; where the stack reflects the modifications of the run-time call
stack.

On Mon, Sep 5, 2011 at 2:27 PM, Benjohn Barnes <benjohn at fysh.org> wrote:

>
> On 5 Sep 2011, at 15:51, Raffael Cavallaro wrote:
>
> >
> > On Sep 5, 2011, at 10:02 AM, Steve Graham wrote:
> >
> >> Can someone help?
> >
> > Marc's reply is, of course, succinct and correct.
> >
> > If you want a fuller understanding of scope, I've found the wikipedia
> article to be relatively clear and to the point:
> > <http://en.wikipedia.org/wiki/Scope_(computer_science)>
> >
> > It covers both lexical (a.k.a. "static") scope, and dynamic scope, and
> gives examples.
>
> If you've got a C language kind of background, to a reasonable
> approximation, dynamic scoping is a lot like a global variable: anyone who
> reads or writes a given binding sees the same one. It caries similar risks
> to a global variable, but there are also some handy things you can do with
> them such as set up exception handlers. Static / lexical scoping is like the
> normal local variables in a function.
>
> Hope that helps (and that if it's nonsense someone will correct me).
>
> Cheers,
>        B
>
> --
> benjohn at fysh.org - Twitter @benjohnbarnes - Skype benjohnbarnes - Mobile +44
> (0) 7968 851 636
>
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110905/f898c6da/attachment.htm>


More information about the Gambit-list mailing list