Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define test '(+ (^ x 0) 5))
- (define (rewrite-poly poly)
- (let ((term (car poly))
- (cond ((empty? poly) '())
- ((and (= (car term) '^) (= (caddr term 0)))
- (cons 1 (rewrite-poly (cdr poly)))
- (else (cons term (rewrite-poly (cdr poly))))))
Add Comment
Please, Sign In to add comment