logo - logo.scm Problem A1 part of programming project#4...

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

View Full Document Right Arrow Icon
;;; logo.scm part of programming project #4 ;;; Problem A1 make-line-obj (define (make-line-obj text) (error "make-line-obj not written yet!")) ;;; Problem A2 logo-type (define (logo-type val) (error "logo-type not written yet!")) (define (logo-print val) (logo-type val) (newline) '=no-value=) (define (logo-show val) (logo-print (list val))) ;;; Problem 4 variables (logo-meta.scm is also affected) (define (make env var val) (error "make not written yet!") '=no-value=) ;;; Here are the primitives RUN, IF, and IFELSE. Problem B2 provides ;;; support for these, but you don't have to modify them. (define (run env exp) (eval-line (make-line-obj exp) env)) (define (logo-if env t/f exp) (cond ((eq? t/f 'true) (eval-line (make-line-obj exp) env)) ((eq? t/f 'false) '=no-value=) (else (error "Input to IF not true or false " t/f)))) (define (ifelse env t/f exp1 exp2) (cond ((eq? t/f 'true) (eval-line (make-line-obj exp1) env)) ((eq? t/f 'false) (eval-line (make-line-obj exp2) env)) (else (error "Input to IFELSE not true or false " t/f)))) ;;; Problem B2 logo-pred (define (logo-pred pred)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/30/2010 for the course EECS 21281 taught by Professor Harvey during the Spring '10 term at Berkeley.

Page1 / 4

logo - logo.scm Problem A1 part of programming project#4...

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

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