notes13 - let(2 If you have more than one name-value pair...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
The unnamed function implied by the let can have more than one argument: ;;;;; In file cs61a/lectures/1.3/roots.scm (define (roots a b c) (let ((d (sqrt (- (* b b) (* 4 a c)))) (-b (- b)) (2a (* 2 a))) (se (/ (+ -b d) 2a) (/ (- -b d) 2a) ))) Two cautions: (1) These are not long-term “assignment statements” such as you may remember from other languages. The association between names and values only holds while we compute the body of the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: let . (2) If you have more than one name-value pair, as in this last example, they are not computed in sequence! Later ones can’t depend on earlier ones. They are all arguments to the same function; if you translate back to the underlying lambda-and-application form you’ll understand this. 279...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online