dynamic and lexical scoping - anyone help me understand it?

Started by cormullion, May 20, 2007, 10:21:19 AM

Previous topic - Next topic

cormullion

#15
thanks jeff - i'll work this a few times today to see if it makes sense. I'm grateful that you've spent some time trying to help...



One thing, though - the word lexical to me (and the OED) means "Pertaining or relating to the words or vocabulary of a language. Often contrasted with grammatical." What do computer programmers mean when they use the word?

rickyboy

#16
Quote from: "cormullion"One thing, though - the word lexical to me (and the OED) means "Pertaining or relating to the words or vocabulary of a language. Often contrasted with grammatical." What do computer programmers mean when they use the word?

They mean "of, or related to, program text."  Wikipedia has a nice blurb about it:


http://en.wikipedia.org/wiki/Scope_(programming)" url="http://en.wikipedia.org/wiki/Scope_%28programming%29">
Quote from: "http://en.wikipedia.org/wiki/Scope_(programming)"With static scope, a variable always refers to its nearest enclosing binding. This is a property of the program text and unrelated to the runtime call stack. Because matching a variable to its binding only requires analysis of the program text, this type of scoping is sometimes also called lexical scoping.

Hope that helps!  --Rick[y]
(λx. x x) (λx. x x)

cormullion

#17
yes that was a good bit...  But you can see why i get confused -


QuoteGenerally, certain blocks are defined to create bindings whose lifetime is the execution time of the block; this adds a hint of lexicality to the scoping.

rickyboy

#18
Quote from: "cormullion"yes that was a good bit...  But you can see why i get confused -
QuoteGenerally, certain blocks are defined to create bindings whose lifetime is the execution time of the block; this adds a hint of lexicality to the scoping.

Yes, I agree that part is confusing -- it was a poor choice of words.
(λx. x x) (λx. x x)