CSE 131
Quiz 2 Review

Scope of name
  Statically scoped environments
    Nested subroutines
      Static links (Access links)
      Displays
    Nested blocks -- C/C++
    Problems/Complications
      Aliases
      Redeclaration of names in inner scope/block { ... }
      Internal static variables
        Scope
        Initialization at run time (C++) vs. load time
      Names declared anywhere in scope
      Forward references/Incomplete type declaration/Forward declaration
      Separate compilation
  Dynamically scoped environments
    Static alternatives

Names, Scope, Binding
  Overloading of names (and symbols)
    Subroutine and Operator
    Overloading/Overriding/Coercion/Polymorphic parameters/Generic subroutines
   
  Forward reference
  Incomplete type declaration
  Forward declaration

Separate Compilation
  Declaration vs. Definition
  What can be and what is not checked across separately compiled modules
  Linking

Semantic Type Checking
  Type Compatibility
  Type Equivalence
  Type Inference
  Assignability
  Addressability
  Type Coercion
  Type Cast

  Static compile time checking
  Dynamic run time checking

  Basic/Primitive/Built-in types
    Widening/Narrowing
    
  Composite types
    Records
    Unions
    Pointers
    Arrays

  Type Equivalence
    Type Aliases
    Structural Equivalence
    Name Equivalence
      Strict
      Loose
    What does C/C++ use?  What does Java use?
    Subverting name equivalence in C/C++
  
  modifiable l-values, non-modifiable l-values, r-values
    C/Reduced-C operators that result in a modifiable l-val
  
  Type Compatibility
    Explicit type conversions and casts
      Non-converting casts / casts requiring run time conversion (and checks)
      Type subversions
    Implicit type coercion
      Different type rules in C and Java, for example
      Generic types
      Operator overloading and Copy/Type constructors

  Type inference
    Based on the overall expression vs. immediate operands/operator

  modifiable l-values, non-modifiable l-values, r-values
    C/Reduced-C operators that result in a modifiable l-val