Guest User

Untitled

a guest
May 14th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.38 KB | None | 0 0
  1. (defun p+ (p1 p2)
  2.   "Adds the two given polynomials together."
  3.   (let ( (output '()) )
  4.     (
  5.       (mapcar #'(lambda (x) ; operates on successive elements of the first polynomial
  6.        (concatenate 'list (list x) output)
  7.       )  p1)
  8.       (mapcar #'(lambda (y) ; does the same with the second polynomial
  9.        (concatenate 'list (list y) output)
  10.       ) p2)
  11.     )
  12.   )
  13. )
Add Comment
Please, Sign In to add comment