Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Lexical scope, shadowing, dynamic scope?

Ook bekend als: lexical scope · shadowing · dynamic scope

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

Lees in het hoofdstuk →