anchor.diff:                                      (ensure-cadr arg))) args)
                        ,return-type) ,name))))
   
  -(defun emit-multiple-value-call-function (type name args doc body)
  -  `((defun ,name ,(mapcar #'ensure-car args)
  -      ,doc
  -      (with-vectors ,args
  -        (multiple-value-call #',type
  -          (progn ,@body))))))
  -
  -(defun emit-with-vectors-function (name args doc body)
  +(defun emit-vector-function (name args doc body)
     `((defun ,name ,(mapcar #'ensure-car args)
         ,doc
         (with-vectors ,args
  
positive.code:         (mv-name (symbolicate name "%")))
      (flet ((option? (option default)
               (getf options option default)))
        (cond ((eq type 'scalar)
               (nconc (list 'progn)
                      (emit-declarations type element-type name arglist :inline (option? :inline t))
                      (emit-with-vectors-function name arglist doc body)
                      (when (option? :scalar-args-version t)
                        (let ((scalar-args (expand-vector-lambda-list arglist)))
                          (nconc (emit-declarations type element-type scalar-args-name scalar-args)
                                 (emit-plain-function scalar-args-name scalar-args
                                                      (concatenate 'string doc "
  Multiple values version. Takes the individual vector element as arguments.")
                                                      body))))))
  
              ;; Emit functions for a vector operation returning type not defined
              ;; with defvector. This may be the types vec and mat.
              ((null slot-list)
               (nconc (list 'progn)
                      (emit-declarations type element-type name arglist :inline (option? :inline nil))
                      (emit-with-vectors-function name arglist doc body)))
  
              ;; Emit functions for a vector operation returning a vector type
              (t
               (nconc (list 'progn)
                      ;; main function
                      (emit-declarations type element-type name arglist)
                      (emit-multiple-value-call-function type name arglist doc body)
                      ;; function returning multiple values
                      (emit-declarations (slot-list-to-values element-type slot-list)
                                         element-type mv-name arglist)
                      (emit-with-vectors-function mv-name arglist doc body)
                      ;; destructive function
                      (when (and (option? :destructive-version t)
                                 (eq type (ensure-cadr (first arglist))))
                        (nconc (emit-declarations type element-type destructive-name arglist)
                               (emit-destructive-function destructive-name arglist
                                                          (concatenate 'string doc "
  Will destructivly modify the the first parameter to contain the result
  of the operation.")
                                                          body)))
                      ;; function with flat arglist
                      (when (option? :scalar-args-version t)
                        (let ((scalar-args (expand-vector-lambda-list arglist)))
                          (nconc (emit-declarations (slot-list-to-values element-type slot-list)
                                                    element-type scalar-args-name scalar-args)
                                 (emit-plain-function scalar-args-name scalar-args
                                                      (concatenate 'string doc "
  Multiple values version. Takes individual vector components as arguments
  and returns the result as multiple values.")
                                                      body))))))))))
  
  
  ;;; types.lisp ends here
  
negative.code:   `((defun ,name ,(mapcar #'ensure-car args)
        ,doc
        ,@body)))
  
  ;;;; ---------------------------------------------------------------------------
  ;;;; * Vector function defining macro
  