(defgeneric zerop1 (arg) (:method ((n number)) ; (= n 0) (zerop n))) (defgeneric minusp1 (arg) (:method ((n number)) ; (< n 0) (minusp n))) (defmethod print-object ((p polynom) stream) (format stream "[МЧ (~s) ~:{~:[~:[+~;-~]~d~[~2*~;~s~*~:;~s^~d~]~;~]~}]" (var p) (mapcar (lambda (term) (list (zerop1 (coeff term)) (minusp1 (coeff term)) (if (minusp1 (coeff term)) (abs (coeff term)) (coeff term)) (order term) (var p) (order term))) (terms p))))