|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+(defun poly+ (poly1 poly2)
|
|
|
2
|
+ (format t "Poly One: ~d~%" poly1)
|
|
|
3
|
+ (format t "Poly Two: ~d~%" poly2)
|
|
|
4
|
+ (if (equal (length poly1) 1)
|
|
|
5
|
+ (format t "Poly 1 has exactly one term: ~a Ex: ~a Mul: ~a~%"
|
|
|
6
|
+ (find-variable-symbol poly1)
|
|
|
7
|
+ (find-exponent poly1)
|
|
|
8
|
+ (find-multiplier poly1))
|
|
|
9
|
+ (format t "Poly 1 has more than one term~%")))
|
|
|
10
|
+
|
|
|
11
|
+(defun collect-like-terms (poly)
|
|
|
12
|
+ (format t "collecting terms"))
|
|
|
13
|
+
|
|
|
14
|
+(defun find-variable-symbol (single-poly)
|
|
|
15
|
+ (car (car (car single-poly))))
|
|
|
16
|
+
|
|
|
17
|
+(defun find-exponent (single-poly)
|
|
|
18
|
+ (cdr (car (car single-poly))))
|
|
|
19
|
+
|
|
|
20
|
+(defun find-multiplier (single-poly)
|
|
|
21
|
+ (cdr (car single-poly)))
|
|
|
22
|
+
|
|
|
23
|
+(poly+ '(((x 2) 3)) '(((y 2) 4)))
|
|
|
24
|
+(poly+ '(((x 2) 3) ((y 2) 3)) '(((y 2) 4)))
|