A simple polynomial calculator in lisp

poly.cl 389B

12345678910111213141516
  1. (defun poly+ (poly1 poly2)
  2. (format t "Poly One: ~d~%" poly1)
  3. (format t "Poly Two: ~d~%" poly2))
  4. (defun find-variable-symbol (single-poly)
  5. (car (car (car single-poly))))
  6. (defun find-exponent (single-poly)
  7. (cdr (car (car single-poly))))
  8. (defun find-multiplier (single-poly)
  9. (cdr (car single-poly)))
  10. (poly+ '(((x 2) 3)) '(((y 2) 4)))
  11. (poly+ '(((x 2) 3) ((y 2) 3)) '(((y 2) 4)))