weird - Ru Wang 20319247 CS135 Sect 001 Tut 108 Question 1:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 Ru Wang 20319247 CS135 Sect 001 Tut 108 Question 1: (a) (weird 1 2 3) => (cond [(symbol? 2) 0] [else (weird (+ 1 2) 3)]) => (cond [false 0] [else (weird (+ 1 2) 3)]) => (cond [else (weird (+ 1 2) 3)]) => (weird (+ 1 2) 3) => (weird 3 3) => (cond [(symbol? 3) 0] [else (weird (+ 3 3))]) => (cond [false 0] [else (weird (+ 3 3))]) => (cond [else (weird (+ 3 3))]) => (weird (+ 3 3)) => (weird 6) => 6 (b) (weird-fun 1 2 3) => (weird 1 2 3) => (cond [(symbol? 2) 0] [else (weird (+ 1 2) 3)]) => (cond [false 0] [else (weird (+ 1 2) 3)]) => (cond [else (weird (+ 1 2) 3)]) => (weird (+ 1 2) 3) =>
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 (weird 3 3) => (cond [(symbol? 3) 0] [else (weird (+ 3 3))]) => (cond [false 0] [else (weird (+ 3 3))]) => (cond [else (weird (+ 3 3))]) => (weird (+ 3 3)) => (weird 6) => (c) (weird 'a 'b (/ 5 0)) => ERROR: cannot divide by 0. (d) (weird-fun 'a 'b (/ 5 0)) => ERROR: cannot divide by 0. (e)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2010 for the course CS 135 taught by Professor Vasiga during the Fall '07 term at Waterloo.

Page1 / 4

weird - Ru Wang 20319247 CS135 Sect 001 Tut 108 Question 1:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online