I. Statements (3.9) A. expression vs. statement-oriented What are basic semantic actions of the languages we've seen? ------------------------------------------ EXPRESSION VS. STATEMENT-ORIENTED (3.9) def: a language is *expression-oriented* if the basic semantic actions with side effects have values and can be used in expressions. Examples: Scheme, def: a language is *statement-oriented* if the basic semantic actions with side effects do not have values and cannnot be used in expressions. Examples: Pascal, ------------------------------------------ What about Perl? C#? Python? Assembler? What kind of language is the defined language that we've seen so far? B. syntax ------------------------------------------ PROGRAMS AND STATEMENTS Example program: var x, y; { x = 3; y = 4; print(+(x, y)) } Examples of statements: x = E print(E) { x1 = E1; x2 = E2 } if E0 { x1 = E1 } { x2 = E2 } while x do x = sub1(x) var x; x = 3 ------------------------------------------ C. semantics 1. domains do we need to change any of the domains? Do we still need to distinguish denoted from expressed values? 2. values? Do statements have values? So if a statement has no value, how do we get information out of the program? 3. interpreter How should the interpreter be organized? What procedures do we need? D. variations 1. assert Why can't users implement assert themselves? 2. loops 3. expression changes a. after-then expressions (like begin) b. bodies can be like implicit begin-expressions c. simplify expressions Are there any expression we can omit now?