Lecture 5, CSE341, Spring 2004 summary (Note: It's unlikely we'll do all this on Wednesday) * Multiple recursive calls * where loops really become painful * depending on results, accumulator-style recursion can be cleaner and faster * examples: summing ropes and converting ropes to lists * More on pattern-matching: * Can match tuples, records, lists, ... anything * No need for explicit types now * using #blah, null, hd, tl, valOf, ... is bad style * Can have deep patterns, which can be very elegant * List examples: zip, nondecreasing * In fact, pattern-matching can be the primitive notion: * if is just a pattern match * variable bindings are just pattern matches * gotcha: misspelled constructor name * in fact, patterns can appear in binding and function arguments * all functions take one argument --> most languages have more restrictive binding forms; now you know some of what you're missing * The text and the instructor disagree on style for case vs. function-patterns --> your choice * type synonyms * equal to their definition * definition of type-equivalence a key language concept * later, we will get to abstract types