Sep 26, 2003 ------------- - More on arrays: associative arrays - really a misnomer, because all arrays are associative - associate keys to values - generalize notion of "index" - e.g., Perl - relates to content-addressable memory - fundamentally different from von Neumann architecture - requires hashing - fast lookups - Structures and records - logical grouping of related things - languages like C actually use them for encapsulation - legal values are cartesian product of constituent legal values - Structures in different languages - Pascal - C - COBOL - Addressing schemes of structural elements - ... OF ... OF ... - 'dot notation' - elliptical references - Operations on arrays - assignment - comparisons - Unions: records gone awry - legal values are union of constituent legal values - Two types - discriminated (e.g., Pascal, Ada) - undiscriminated (e.g., FORTRAN, C) - Variant records - most common type of discriminated unions - Pointers - every language uses them, for memory management - the question is, whether it gives the programmer access to them - indirect addressing - programmer control of mem management - Basic operations on pointers - dereferencing - following links