Topic: declaration scope

topics > computer science > data > Group: type declaration

binding of names to objects
data type by access rights
global declarations and variables
local declaration of data
names defined by context
object-defined names
program module as encapsulation


The scope of a declaration is the region visible to the declaration. (cbb 7/06)

Usually a declaration is local to the enclosing block and global to interior blocks, but a number of alternatives are possible. In cluster oriented languages, data objects may be explicitly exported or imported. In Qlisp, patterns can be defined open/semiopen/closed; while in Smalltalk, variables may be activation temporaries, instance identifying variables, or class variables shared by all objects. (cbb 5/80)

Subtopic: scope up

Quote: an identifier is a symbol or name for a variable, type, procedure, etc. within the scope of its declaration

Subtopic: static vs. dynamic up

Quote: scope is static if procedure called in definition environment while dynamic if called in caller's environment [»maclBJ_1987]
Quote: the 'dynamic' namespace contains the calling agent and whatever is explicitly added [»acheF9_2000]
Quote: Piccola uses its dynamic namespace to implement exception handling [»acheF9_2000]
Quote: implement dynamic variables via set and use statements that allocate from the stack; 'use' searches the 'set' variables for a match [»hansDR6_2001]

Subtopic: problems with dynamic scope up

Quote: equivocation is using the same word in different ways in the same conversation; reflects difficulty of dynamic scoping [»maclBJ_1987]

Subtopic: spatial metaphor up

Quote: computational scoping matches concept of inside in spatial metaphor [»diseAA9_1986]
Quote: spatial metaphor implies hierarchical structures due to box containment [»diseAA9_1986]

Subtopic: literals up

Quote: symbols that are valid handles to objects in most scopes are typically recognized syntactically, e.g., numbers, symbols, and strings [»kentW6_1991]

Subtopic: export up

Quote: a block may grant (export) access rights of local variables to other blocks [»mcgrJR1_1979]

Subtopic: class definition up

Quote: a class definition defines names for temporaries, instance variables, and class variables [»goldA3_1976]
Quote: Smalltalk accessed class variables and methods through the instance variable of the class' metaobject [»batesR11_2004]

Subtopic: record as local scope up

Quote: a record in Pascal defines a local naming scope which is opened with the dot operator [»maclBJ_1987]

Subtopic: arguments up

Quote: the scope of a keyword parameter is its argument expression and its procedure [»parkR7_1978]
Quote: when invoking a procedure, one can 'see' the argument's inner block [»parkR7_1978]
QuoteRef: simscrip_1971 ;;156 before "every" declarations goes switch to tell what class eg Permanent Entities

Related Topics up

Topic: binding of names to objects (19 items)
Topic: data type by access rights (20 items)
Topic: global declarations and variables (33 items)
Topic: local declaration of data (11 items)
Topic: names defined by context (36 items)
Topic: object-defined names (15 items)
Topic: program module as encapsulation
(28 items)

Updated barberCB 4/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.