Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Lexical scope, shadowing, dynamic scope?

Também chamado de: lexical scope · shadowing · dynamic scope

Definition 4.2 University Computer Science — Year 3 · Capítulo 4 — Abstract Syntax and Semantic Analysis

Under lexical scope (or static scope), a declaration is visible in the region of the program text it belongs to: in Moor, from the declaration to the end of its block, inner blocks included. A declaration in an inner block shadows a declaration of the same name in an enclosing one: inside the inner block, the name refers to the inner declaration. Under dynamic scope, a name refers to the most recent declaration still active when the code runs, which depends on the chain of calls and not on the text.

Ler no capítulo →