Hand Evals in DrScheme-PowerPoint

# Hand Evals in DrScheme-PowerPoint - Hand Evals in DrScheme...

• Notes
• davidvictor
• 7

This preview shows pages 1–7. Sign up to view the full content.

Hand Evals in DrScheme Hand evaluation helps you learn how Scheme reduces programs to values

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

Example 1 (+ (* 2 3) 6) (+ 6 6) 12
Example 2 (define (foo x) (+ x 3)) (* (foo 5) 4) (* (+ 5 3) 4) (* 8 4) 32

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

Example 3 (define (foo x) (+ x 3)) (+ (foo 5) (foo 9) (foo -1)) (+ (+ 5 3) (foo 9) (foo -1)) (+ 8 (foo 9) (foo -1)) (+ 8 (+ 9 3) (foo -1)) (+ 8 12 (foo -1))

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • [see next slide] Example 3 (cont) • (define (foo x) (+ x 3)) • (+ 8 12 (foo -1)) • (+ 8 12 (+ -1 3)) • (+ 8 12 2) • 22 Example 4 • (cond [(= 5 0) ‘never] [else (* 6 2)]) • (* 6 2) • 12 Summary: How to Hand Eval 1. Find the innermost expression 2. Evaluate one step 3. Repeat until all have a value...
View Full Document

• Spring '07
• Fisler
• foo, foo -1

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern