1 / 8

CS3L: Introduction to Symbolic Programming

CS3L: Introduction to Symbolic Programming. Summer 2008 Colleen Lewis colleenL@berkeley.edu. Lecture 7: Review. Announcements. Midterm Thursday 9:10-11:10 Open book / open note Mini-Project Due Monday at 11:59 pm Write both names and logins in the file Only submit once

Download Presentation

CS3L: Introduction to Symbolic Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS3L: Introduction to Symbolic Programming Summer 2008 Colleen Lewis colleenL@berkeley.edu Lecture 7: Review

  2. Announcements • Midterm Thursday 9:10-11:10 • Open book / open note • Mini-Project Due Monday at 11:59 pm • Write both names and logins in the file • Only submit once • Ahmed Extra Office Hour 4-5

  3. More announcements • UCWise has planned outage Sundays from 8:00 am to 8:15 am • New Midterm Grade breakdown • Midterm 1 – 12% • Midterm 2 – 18% • Final – 20%

  4. Today • Go over yesterday’s quiz • Take today’s quiz • Go over today’s quiz • Work on the mini-project • Ask questions

  5. Write interpret… • (interpret ‘(+ 3 2)) -> 5 • (interpret ‘(- 4 7)) -> -3

  6. interpret ;; this expects x to be in the format ‘(+ # #) (define ( interpret x) (if (equal? (first x) ‘+) (+ (second x) (third x)) (- (second x) (third x))))

  7. Interpret ;; WRONG!!!! (define (interpret x) ((first x) (second x) (third x))) ;; Right… (define (interpret x) (eval x))

  8. Interpret (define (interpret x) ( (if (equal? (first x) ‘+ ) + - ) ;; become + or – (second x) (last x)))

More Related