Science, asked by revathyrevu7984, 1 year ago

Difference between dynamic and static scoping

Answers

Answered by Harsh951
1
In lexical scope, a variable always refers to its local lexical environment. ... That's why lexical scope is also called static scope. In difference tostatic scope dynamic scope is dependent on the runtime call stack. This means a program needs to be executed to determine the scope ofdynamic variables.
Answered by xxsanshkiritixx
3

Static scoping is also called lexical scoping. In this scoping a variable always refers to its top level environment. ... In contrast, dynamic scope requires the programmer to anticipate all possible dynamic contexts.

Similar questions