Com S 342 meeting -*- Outline -*- * summary of syntax abstraction ** translational or sugaring approach to extending languages ------------------------------------------ MAKING THE LANGUAGE SWEETER Syntactic abstraction = syntactic sugar problem: solution: advantages: ------------------------------------------ ... common pattern, tedium ... new syntax semantics by translation to old pattern ... no need to change compiler no additional interactions but new syntax may allow more optimizations (as in case) Q: What statements in C are defined by syntactic sugar in this way? for, break, continue ** automation principle ------------------------------------------ AUTOMATION PRINCIPLE A language should automate Examples: Bonus: ------------------------------------------ ... common or tedious patterns. Q: What examples have we seen? binding with lambda ==> let boolean-valued ifs ==> and, or nested ifs ==> cond tests against value ==> case ... the pattern may be faster than the general case