CS 342 Lecture -*-Outline-*- * the CLU interpreter (6.3) point is to see how the settors, selectors and constructor work also 2 part names ** Clusters How are clusters represented? CLUSTERREC on page 222 note field names i nclrep exported vs. non-exported function definitions the non-exported ones are the privilaged operations settors, selectors, constructor FUNDEFREC p. 222 note that constructors, selectors, and settors are treated specially: no body, settor only has name of field How the privilaged operations are created: look at ParseCluster, bottom of 548 Pascal variable named rep is assigned list of field names (of CLU rep) on p. 549, the constructor is created, with name of the cluster then each field in the rep list is turned into a selector and a settor then the privialbed operations are placed in the nonexported part of the cluster record (cenv) ** CLU Values User defined vaules are distinguished from primitive values (ints) user values have an environment, which is the record (names+values) defined by the rep so constructor takes list of field names, and list of values (its args) and wraps them up into this record-like value ** Evaluation (6.3.7) eval has not only an environment, but a cluster record as an argument outside cluster: cluster record is nil inside cluster: allows access to nonexported operations application of user funtions (p. 224): two part names: find cluster, then get function from its exported list (note: can't access privilaged ops this way) one part names: if outside cluster, as before if within cluster: look in that cluster's exported list, then in nonexported list finally in globals look at how selectors and settors work (p. 225)