anchor.diff:  	   (super (most-specific-proxy-superclass class))
   	   (gtype (or 
   		   (first (ginstance-class-gtype class))
  -		   (default-alien-type-name class-name)))
  -	   (type-number
  -	    (or 
  -	     (find-type-number class-name)
  -	     (let ((type-number
  -		    (if (or 
  -			 (symbolp gtype)
  -			 (type-number-from-glib-name gtype nil))
  -			(register-type class-name gtype)
  -		      (register-new-type class-name (class-name super) gtype))))
  -	       (type-class-ref type-number)
  -	       type-number))))
  +		   (default-alien-type-name class-name))))
  +      (unless (type-registered-p class-name)
  +	(type-class-ref
  +	 (if (or (symbolp gtype) (type-number-from-glib-name gtype nil))
  +	     (register-type class-name gtype)
  +	   (register-new-type class-name (class-name super) gtype))))
         #+nil
         (when (and
  -	     (supertype type-number) 
  -	     (not (eq (class-name super) (supertype type-number))))
  +	     (supertype (find-type-number class))
  +	     (not (eq (class-name super) (supertype (find-type-number class)))))
   	(warn "Super class mismatch between CLOS and GObject for ~A" 
   	      class-name)))
       (update-size class))
  
positive.code: (defun type-from-glib-name (name)
    (type-from-number (type-number-from-glib-name name) t))
  
  (defun register-type (type id)
    (cond
     ((find-type-number type))
     ((not id) (warn "Can't register type with no foreign id: ~A" type))
     (t    
      (pushnew (cons type id) *registered-types* :key #'car)
  
negative.code: 			   t))))))
  
  
  (defun expand-type-definitions (type-list &optional args)
    (flet ((type-options (type-number)
  	   (let ((name (find-foreign-type-name type-number)))
  	     (cdr (assoc name args :test #'string=)))))
  
      (setq type-list
       (delete-if
        #'(lambda (type-number)
  	  (let ((name (find-foreign-type-name type-number)))
  	    (or
  	     (getf (type-options type-number) :ignore)
  	     (find-if
  	      #'(lambda (options)
  		  (and
  		   (string-prefix-p (first options) name)
  		   (getf (cdr options) :ignore-prefix)
  		   (not (some
  			 #'(lambda (exception)
  			     (string= name exception))
  			 (getf (cdr options) :except)))))
  	      args))))
        type-list))
  
      (dolist (type-number type-list)
        (let ((name (find-foreign-type-name type-number)))
  	(register-type
  	 (getf (type-options type-number) :type (default-type-name name))
  	 (register-type-as type-number))))
  
      ;; This is needed for some unknown reason to get type numbers right
      (mapc #'find-type-dependencies type-list)
  
      (let ((sorted-type-list 
  	   #+clisp (mapcar #'list type-list)
  	   #-clisp
  	   (sort-types-topologicaly 
  	    (mapcar 
  	     #'(lambda (type)
  		 (cons type (find-type-dependencies type (type-options type))))
  	     type-list))))
        `(progn
  	 ,@(mapcar
  	    #'(lambda (pair)
  		(destructuring-bind (type . forward-p) pair
  		  (expand-type-definition type forward-p (type-options type))))
  	    sorted-type-list)
  	 ,@(mapcar
  	    #'(lambda (pair)
  		(destructuring-bind (type . forward-p) pair
  		  (when forward-p
  		    (expand-type-definition type nil (type-options type)))))
  	    sorted-type-list)))))
  
  (defun expand-types-with-prefix (prefix args)
    (expand-type-definitions (find-types prefix) args))
  
  (defun expand-types-in-library (system library args)
    (let* ((filename (library-filename system library))
  	 (types (loop 
  	         for (type-init . %filename) in *type-initializers*
  		 when (equal filename %filename)
  		 collect (funcall type-init))))
      (expand-type-definitions types args)))
  
  (defun list-types-in-library (system library)
    (let ((filename (library-filename system library)))
      (loop 
       for (type-init . %filename) in *type-initializers*
       when (equal filename %filename)
       collect type-init)))
  
  (defmacro define-types-by-introspection (prefix &rest args)
    (expand-types-with-prefix prefix args))
  
  (defexport define-types-by-introspection (prefix &rest args)
    (list-autoexported-symbols (expand-types-with-prefix prefix args)))
  
  (defmacro define-types-in-library (system library &rest args)
    (expand-types-in-library system library args))
  
  (defexport define-types-in-library (system library &rest args)
    (list-autoexported-symbols (expand-types-in-library system library args)))
  
  
  ;;;; Initialize all non static types in GObject
  