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


Categories of Variables by Lifetimes



Download 396.24 Kb.
Page10/16
Date18.02.2022
Size396.24 Kb.
#58269
1   ...   6   7   8   9   10   11   12   13   ...   16
13516098

Categories of Variables by Lifetimes

(4) Implicit heap-dynamic: Allocation and deallocation caused by assignment statements.

    • all strings and arrays in Perl, JavaScript, and PHP
  • Advantage: flexibility (generic code)
  • Disadvantages:
  • lifetime = from implicit allocation to implicit deallocation

Type Checking

  • Generalize the concept of operands and operators to include subprograms and assignments
  • Type checking is the activity of ensuring that the operands of an operator are of compatible types
  • A compatible type is one that is either legal for the operator, or is allowed under language rules to be implicitly converted, by compiler- generated code, to a legal type
  • A type error is the application of an operator to an operand of an inappropriate type

Download 396.24 Kb.

Share with your friends:
1   ...   6   7   8   9   10   11   12   13   ...   16




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

    Main page