Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Lexical scope, shadowing, dynamic scope » ?

Aussi appelé : lexical scope · shadowing · dynamic scope

Definition 4.2 University Computer Science — Year 3 · Chapitre 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.

Lire dans le chapitre →