anchor.diff:  	  (funcall proc term (contents term-list))
   	  (error "not this type in package -- adjoin-term ~A" (list type-tags))))))
   
  -
  +(defun the-empty-termlist () (the-sparse-empty-termlist))
               
   
   (let ((spar (the-sparse-empty-termlist))
         (dens (the-dense-empty-termlist))
  -      (term (make-term 2 3))
  +      (t1 (make-term 2 3))
         (t2 (make-term 3 3)))
     (labels ((show (x)
   	     (format t "~%~A~%" x)))
  -    (show (adjoin-term term spar))
  -    (show (adjoin-term term dens))))
  +   (let ((l1 (adjoin-term t1 spar))
  +	 (l2 (adjoin-term t2 dens)))
  +     (show "test begin")
  +     (show l1)
  +     (show l2)
  +     (show (add-terms l1 l1))
  +     (show (mul-terms l1 l1))
  +    
  +
  +     (show (add-terms l2 l2))
  +     (show (mul-terms l2 l2))
  +    
  +     (show "test end")
  +     'done)))
   
   
   ;;;;2.91
   
  +(defun div-terms (l1 l2)
  +  (if (empty-termlist? l1)
  +      (list (the-empty-termlist) (the-empty-termlist))
  +      (let ((t1 (first-term l1))
  +	    (t2 (first-term l2)))
  +	(if (> (order t2) (order t1))
  +	    (list (the-empty-termlist) l1)
  +	    (let ((new-c (div (coeff t1) (coeff t2)))
  +		  (new-o (- (order t1) (order t2))))
  +	      (let ((rest-of-result (div-terms (sub-terms l1 
  +							  (mul-terms l2
  +								     (make-term new-o new-c)))
  +					       l2)))
  +		(list (add-terms (car rest-of-result) 
  +				 (make-term new-o new-c))
  +		      (cadr rest-of-result))))))))
  +
  +;;;;2.92
  +
  +
  +
  +							  
  +								     
  
positive.code: ;;;;2.89
  (defun adjoin-term-dense (term term-list)
    (cond ((=zero? (coeff term)) term-list)
  	((equ? (order term) (length term-list)) 
  	 (cons (coeff term) term-list))
  	(t (adjoin-term-dense term (cons 0 term-list)))))
  
  
negative.code: (defun install-dense-term-list-package ()
    (labels ((tag (x) (attach-tag 'dense x))
  	   (adjoin-term-dense (term term-list)
  	     (cond ((> (order term) (length term-list))
  		    (adjoin-term-dense term (cons 0 term-list)))
  		   
  		   (t 
  		    (cons (coeff term) term-list))))
  
  
  	   (the-empty-termlist () '())
  	   	   
  	   (empty-termlist? (term-list)
  	     (null term-list))
  	   (first-term (term-list)
  	     (make-term (- (length term-list) 1) (car term-list)))
  	   (rest-terms (term-list)
  	     (cdr term-list)))
      (my-put 'adjoin-term 'dense 
  	    #'(lambda (term term-list)
  		(tag (adjoin-term-dense term term-list))))
      (my-put 'first-term '(dense) #'first-term)
      (my-put 'rest-terms '(dense) #'(lambda (termlist) (tag (rest-terms termlist))))
      (my-put 'the-empty-termlist 'dense #'(lambda () (tag (the-empty-termlist))))
      (my-put 'empty-termlist? '(dense) #'empty-termlist?)
      (my-put 'add-terms '(dense dense) #'(lambda (l1 l2) (tag (add-terms l1 l2))))
      (my-put 'mul-terms '(dense dense) #'(lambda (l1 l2) (tag (mul-terms l1 l2))))
      'done))
  (install-dense-term-list-package)
  
  
  
  (defun adjoin-term (term term-list)
    (let ((type-tags (type-tag term-list)))
  