You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(define (tree-replace t x y)
; replace all occurences of x with y in the tree t
(def (tr t) (tree-replace t x y))
(cond
[(equal? t x) y]
[(list? t) (map tr t)]
[else t]))
(let ([a -4] [b -1] [c 5] [d -9] [x 'x] [y 'y])
(tex (tree-replace (tree-replace `(+ (* ,a (sqr ,x)) (* ,b (sqr ,y)) (* ,c x y) (* ,d x))
'x 2)
'y 5)))
The text was updated successfully, but these errors were encountered: