Static Scoping Example-1

preview_player
Показать описание
Static Scoping Example-1

The scope of a variable x in the region of the program in which uses of x refers to its declaration.
One of the basic reasons of scoping is to keep variables in different parts of the program distinct from one another.

Scoping is generally divided into two classes:
1.Static Scoping
2.Dynamic Scoping

Static Scoping
In this scoping, a variable always refers to its top-level environment.
that means if the variable is not found in the current stack or in local space then the compiler will be searching in global or static space.

Dynamic Scoping:
With the dynamic scope, a global identifier refers to the identifier associated with the most recent environment and is uncommon in modern languages.
It is not being used by most of the compiler because of the security concern.

Gate CS/IT videos
Static Scoping Example-1
Рекомендации по теме