Static and Dynamic Scoping-3

preview_player
Показать описание
Static and Dynamic Scoping-3

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.

#GATE_2021, #GATE , #GATE_PREPARATION

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_2021, #GATE , #GATE_PREPARATION , #focalpoint , #gateexam, #gate_cs , #focalpoint , #gateexam , #gate_cse

Gate CS/IT videos
Рекомендации по теме