Com S 342 meeting -*- Outline -*- * Adding Arrays (6.1) Note: Remind students to get the revised chapter 6, if they have an older copy of the book! Warning to students: we do things differently, even from the revision... ** context Q: What's missing from our defined langauge so far? make a list ------------------------------------------ AGGREGATE DATA STRUCTURES def: an *aggregate* data structure is How is aggregate data passed to procedures? ------------------------------------------ ... one that has multiple elements, such as an array or record. ... in C/C++: indirect = pass pointer to cell containing first element the pointer is passed by value, so assigning it doesn't change the aggregate What else could be done? in Pascal: direct = pass a copy of the aggregate "itself", assignment changes the aggregate directly We'll add arrays to illustrate both of these ideas. but they also apply to passing objects, as in Java or Smalltalk, vs. copying them (as can be done in C++) ** syntax ------------------------------------------ ARRAYS Concrete syntax: