anchor.diff:    ())
   
   (defmethod compile-ast ((ast u--ast) value-context successor)
  -  (unless (and (list value-context)
  -	       (member (length value-context) '(1 2)))
  -    (error "invalid value context"))
  -  (let ((temp1 (new-temporary))
  -	(temp2 (new-temporary)))
  -    (let ((instruction (make-instance 'u--instruction
  -				      :inputs (list temp1 temp2)
  -				      :outputs (car value-context)
  -				      :next successor)))
  -      (compile-ast (car (arguments ast))
  -		   (list temp1)
  -		   (compile-ast (cadr (arguments ast))
  -				(list temp2)
  -				instruction)))))
  +  (multiple-value-bind (new-successor new-value-context)
  +      (adapt-value-context value-context 1 2 successor)
  +    (let* ((temps (make-temps (arguments ast)))
  +	   (instruction (make-instance 'u--instruction
  +				       :inputs temps
  +				       :outputs new-value-context
  +				       :next new-successor)))
  +      (compile-arguments (arguments ast) temps instruction))))
   
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;;;
  
positive.code:   ())
  
  (defmethod compile-ast ((ast u+-ast) value-context successor)
    (unless (and (list value-context)
  	       (member (length value-context) '(1 2)))
      (error "invalid value context"))
    (let ((temp1 (new-temporary))
  	(temp2 (new-temporary)))
      (let ((instruction (make-instance 'u+-instruction
  				      :inputs (list temp1 temp2)
  				      :outputs (car value-context)
  				      :next successor)))
        (compile-ast (car (arguments ast))
  		   (list temp1)
  		   (compile-ast (cadr (arguments ast))
  				(list temp2)
  				instruction)))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
  
negative.code:   ((%inputs :initarg :inputs :reader inputs)
     (%outputs :initarg :outputs :reader outputs)))
  
  (defun adapt-value-context (desired min-supplied max-supplied successor)
    (cond ((eq desired t)
  	 (let ((context (loop repeat max-supplied collect (new-temporary))))
  	   (values context
  		   (make-instance 'leave-instruction
  				  :sources context
  				  :next successor))))
  	((<= min-supplied (length desired) max-supplied)
  	 (values desired successor))
  	(t
  	 (error "incorrect number of values expected"))))
  
  (defun make-temps (arguments)
    (loop repeat (length arguments) collect (new-temporary)))
  
  (defun compile-arguments (arguments temps successor)
    (loop with succ = successor
  	for arg in (reverse arguments)
  	for temp in (reverse temps)
  	do (setf succ (compile-ast arg (list temp) succ))
  	finally (return succ)))
  
  ;;; There is lots of code duplication in this file at the moment.
  ;;; Need to figure out how to factor it properly.
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;
  ;;; Word operation MEMALLOC.
  