Lexical Scoping

What does Lexical Scoping mean?

Lexical scoping is setting the scope of a functionality of a certain variable using a method, which facilitates calling the variable from the code block in which it was defined. It is only during the compilation phase in which the scope is determined. A private variable is a variable declared in a manner compatible with this definition.

This term is also known as static scoping.


Techopedia explains Lexical Scoping

Lexical scoping allows variables to be declared within a specific scope and it is only accessible within that region. Lexical scoping allows for lexical closures, but the absence of closures still ensures that the scope allows the function to be re-entrant. However, the absence of closures gives rise to dynamic scoping.

Lexical scoping is standardized in all algorithmic languages (ALGOL), such as Ada, Pascal, and Modula2. Additionally, it is used in modern functional languages like ML and Haskel.


Share this Term

  • Facebook
  • LinkedIn
  • Twitter

Survey: Why Is There Still a Gender Gap in Tech?

Do you work in the tech industry? Help us learn more about why the gender gap still exists in tech by taking this quick survey! Survey respondents will also be entered to win a $100 Amazon Gift Card!

Related Reading


DevelopmentJavaProgramming ToolsProgramming LanguagesApplication Programming Interfaces (APIs)Object Oriented Programming (OOP)

Trending Articles

Newest Articles

Go back to top