Fix inaccurate comment in exercise 2.57
This commit is contained in:
parent
f5131b16db
commit
39d48f34f4
1 changed files with 4 additions and 4 deletions
|
@ -20,10 +20,10 @@
|
|||
(filter predicate (cdr sequence))))
|
||||
(else (filter predicate (cdr sequence)))))
|
||||
|
||||
; only folds the beginning constants of the top-level expression
|
||||
; e.g. (+ 2 3 5 x) becomes (+ 10 x)
|
||||
; folds the constants of the top-level expression
|
||||
; e.g. (+ 2 3 x 5) becomes (+ 10 x)
|
||||
; (+ x y z) -> (+ x y z)
|
||||
; (* 2 0 3 x) -> 0
|
||||
; (* 2 x 0 3) -> 0
|
||||
; (+ 3 -3 x) -> x
|
||||
(define (fold exp)
|
||||
(if (and (not (sum? exp)) (not (product? exp)))
|
||||
|
@ -117,4 +117,4 @@
|
|||
(deriv (base exp) var))
|
||||
(error "non-constant exponents not yet supported: DERIV" exp)))
|
||||
(else
|
||||
(error "unknown expression type: DERIV" exp))))
|
||||
(error "unknown expression type: DERIV" exp))))
|
||||
|
|
Loading…
Add table
Reference in a new issue