Computer Science, asked by hamanidb7487, 1 year ago

Difference between static scope and dynamic scope in compiler design

Answers

Answered by Deadpool123
0
Dynamic scope refers to scope of a variable is defined at run time rather than at compile time. Perl language allows dynamic scoping. Coming to your question a=2,b=3 are defined in fun1() which is the most recent scope and dynamic scope for a,b variables
Answered by xxsanshkiritixx
2

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