anchor.diff:              do (format t "~&writing functions to file ~s~%" path)
               do (with-open-file (out path :direction :output
                                            :if-exists :supersede)
  -                 #+let ((out *standard-output*))
                    (format out ";;; this file is automatically generated, do not edit~%")
                    (format out ";;; generated from files with the following copyright:~%;;;~%")
                    (with-input-from-string (c copyright)
  
positive.code:           (xpath:do-node-set (e (xpath:evaluate "enum" node))
              (let ((n (convert-enum-name (xpath:string-value
                                           (xpath:evaluate "@name" e))))
                    #++(alias (convert-enum-name (xpath:string-value
                                                  (xpath:evaluate "@alias" e))))
                    (v (hex (xpath:string-value (xpath:evaluate "@value" e)))))
                #++(when alias
                     (add alias v))
                (add n v)))))))
    #++(maphash (lambda (k v)
                  (format t "~s ->~%  ~s~%" k (alexandria:hash-table-alist v)))
                enums)
  
  
    ;; extract functions
    (xpath:do-node-set (node (xpath:evaluate "/registry/commands/command" gl.xml))
      (let* ((proto (xpath:first-node (xpath:evaluate "proto" node)))
             (name (sv "name" proto))
             #++
             (alias (xpath:map-node-set->list
                     #'xpath:string-value (xpath:evaluate "alias/@name" node)))
             (ret (if (equalp (sv "@group" proto) "String")
                      "string"
                      (get-type proto))
                  #++(or (sv "proto[/ptype and text()]" node)
                         (sv "proto/text()" node)))
             (args (xpath:map-node-set->list
                    (lambda (p)
                      (list* :name (let ((n (sv "name" p)))
  
negative.code:       (unless (or (find (string-upcase (translate-type-name name)) types
                          :test 'string=)
                    (find name *base-types* :key 'car :test 'string=))
          (format t "new type ~s : (defctype ~(~s~) ~s) ~%"
                  name
                  (string-upcase (translate-type-name name))
                  (xpath:string-value (xpath:evaluate "text()" node))))))
  
    ;; extract bitfields
    (xpath:do-node-set (node (xpath:evaluate "/registry/enums[@type=\"bitmask\"]" gl.xml))
  