Learning Objectives: Understand binding and typing and namespaces Understand variable scope Be able to identify both static and dynamic scope Understand basic types and their implementation Know implementation of arrays Be able to program and/or trace simple FORTRAN, Python, C Variables=(name,address,value,type,lifetime,scope) Aliases, binding and binding times Names: case-sensitivity, length, style (_ vs. camel), reserved or not Addresses can vary (think stack-dynamic and redeclarations); meaning of l-value Type as range of values and applicable operations; abstract vs. physical memory cells Binding times: language-design, language-implementation, compile-time, link/load/run-time Static vs. dynamic; physical mapping (segmentation/paging etc.) abstracted away... Understand explicit and implicit static type binding Distinguish declaration from definition Understand an example of dynamic type binding Four categories of storage binding: static, stack-dynamic, explicit and implicit heap-dynamic History/structural sensitivity of static variables; lifetime Relationship of scope to stack-dynamic lifetime Advantages and disadvantages of explicit heap-dynamic variables Implicity heap-dynamic management; garbage collection Static type checking, coercion and dynamic type checking (think virtual) Strong typing examples and nearly strong typing; advantage and disadvantage Type compatibility and type equivalence (name vs. structural) Static scope rules and static ancestry; follow an exmple of name-resolution using scope; application to blocks Hiding possibilities of scope and evaluation of this Problems with static scope include forcing programs into unusual configurations Dynamic scope rules and dynamic ancestry; follow an example of name-resolution given a sequence of calls Referencing environments (know definition) (just another way of capturing scope) Primitive data types vs. user-defined data types Basic information about these data types: Integer Floating-point Decimal Boolean Character Character strings: array or built-in or object, null-termination and associated errors, regular expressions for pattern matching Character strings: static or dynamic length and associated bookkeeping, three styles of storage management for dynamic What is an enumeration type? Know the three design issues on p. 259 What are subrange types? How do they differ from derived types in terms of type checking? Know the points made in section 6.4.3 Know the design issues for array types on p. 263 Why does Fortran choose to use the same syntax for array indexing as for function calls? What is involved in subscript range checking? Must it be done? Do all languages do it? How is array initialization handled in different languages? What is a static array? What is a fixed stack-dynamic array? What is an advantage of using them? What is a stack-dynamic array? What is a fixed heap-dynamic array? What is a heap-dynamic array? (In all of these, what are the binding times of indices and storage?) How are declare blocks in Ada used with stack-dynamic arrays on p. 266 What keywords or function calls are used in C/C++ for allocation and deallocation of fixed heap-dynamic arrays? How are arrays handled in Java? Be familiar with the various initialization methods in section 6.5.5 What kinds of operations are typical for arrays? What is a slice of an array (give a specific example)? Given a two-dimensional array, show how the address of an element is computed from the indices and element type What are row-major and column-major order? Be able to show the difference in an example What is an associative array?