Contents Introduction Names Variables The Concept of Binding Type Checking Strong Typing Type Equivalence Scope Scope and Lifetime Referencing Environments Named Constants Introduction



Download 396.24 Kb.
Page13/16
Date18.02.2022
Size396.24 Kb.
#58269
1   ...   8   9   10   11   12   13   14   15   16
13516098

Static Scope

Scope (continued)

  • Variables can be hidden from a unit by having a "closer" variable with the same name
  • C++ and Ada allow access to these "hidden" variables
    • In Ada: unit.name
    • In C++: class_name::name

Blocks

    • A method of creating static scopes inside program units--from ALGOL 60
    • Examples:
    • C-based languages:


      Download 396.24 Kb.

      Share with your friends:
1   ...   8   9   10   11   12   13   14   15   16




The database is protected by copyright ©ininet.org 2024
send message

    Main page