CSC151.02 2003F, Class 11: Conditionals, Continued Admin: * Bad Michael! Don't miss class and make your advisor cranky. * Questions on the homework? * Sorry, I forgot a reading. We'll go over it today. * Two new readings: Characters, Strings * MathLAN tutoring, Sunday-Thursday, 9-10 p.m. * Sam and Reese critique your sites Overview: * Review * Basic comparisons * Type Predicates * Boolean functions * The cond operations * Lab: Conditionals Review: * The if expression in Scheme (if TEST TRUE-PART FALSE-PART) * If the TEST evaluates to anything but false, evaluates TRUE-PART * If the TEST evaluates to false, evaluates FALSE-PART What kinds of tests can you have? * Comparisons (< x y) (> x y) (<= x y) (= x y) ... * Type predicates (number? x) (list? x) (null? x) (zero? x) (real? x) ... * Combine predicates (if (or (< x y) (< y z)) ... ...) (or EXP1 EXP2) * If EXP1 evaluates to false and EXP2 evaluates to false, the value is false * If either does not evaluate to false, the value is something that is not false (and EXP1 EXP2) * If EXP1 evaluates to false or EXP2 evaluates to false, the value is false * Otherwise, it's some non-false value (not EXP1) * If EXP1 evaluates to something that is not false, this evaluates to false * If EXP1 evaluates to false, this is true. Start the lab! Ask questions when things get confusing. We'll probably continue tomorrow. We'll finish the lab tomorrow.