anchor.diff:          (export (,@(slot-value target 'symbols)))
           ,code))))
   
  -(defun gen-stub-file (object filename &key package-def)
  +(defun gen-stub-file (object filename &key package-def dynamic-stubs)
     (with-open-file (*standard-output* filename :direction :output :if-exists :supersede)
  -    (let* ((target (make-instance 'code-target))
  +    (let* ((target (make-instance 'code-target :dynamic-stubs dynamic-stubs))
              (code (target-code object target)))
  -      (print '(in-package :clorb))
  +      (pprint '(in-package :clorb))
         (when package-def
           (loop for package in (slot-value target 'packages)
                   unless (member package *stub-code-ignored-packages*)
                   do (terpri)
                      (pprint (make-allways-eval 
                               (make-target-ensure-package package target)))))
  -      (mapc (lambda (x) (terpri) (pprint x))
  -            (remove nil (cdr code)))
  +      (dolist (x (remove nil (cdr code)))
  +        (terpri)
  +        (pprint x))      
         (terpri))))
   
  +
  +;; ----------------------------------------------------------------------
  +;;;; Configure the pretty printer
  +;; ----------------------------------------------------------------------
  +
  +(set-pprint-dispatch '(cons (member define-method)) 
  +                     (pprint-dispatch '(defmethod foo ()) ))
  +
  +(defun pprint-def-and-keys (*standard-output* list)
  +  (pprint-logical-block (nil list :prefix "(" :suffix ")")
  +    (write (pprint-pop))
  +    (write-char #\Space)
  +    (pprint-exit-if-list-exhausted)
  +    (write (pprint-pop))
  +    (loop
  +      (pprint-exit-if-list-exhausted)
  +      (write-char #\Space)
  +      (pprint-newline :linear)
  +      (write (pprint-pop))
  +      (pprint-exit-if-list-exhausted)
  +      (write-char #\Space)
  +      (write (pprint-pop)))))
  +
  +(set-pprint-dispatch '(cons (member define-user-exception define-corba-struct))
  +                     'pprint-def-and-keys)
   
   #|
   (load "clorb:src;iop-idl")
   (gen-stub-file (lookup-name "IOP") "clorb:x-iop.lisp")
  -(gen-stub-file (lookup-name "CORBA") "clorb:orb-stub.lisp")
   (gen-stub-file (lookup-name "CosNaming") "clorb:x-cosnaming.lisp" :package-def t)
  -
  +(gen-stub-file (vsns-get "clorb") "clorb:x-orb-base.lisp")
  +(gen-stub-file (vsns-get "ir") "clorb:x-ifr-base.lisp")
  +(gen-stub-file (vsns-get "file.i") "clorb:x-file.lisp")
  +
  +(load "clorb:src;ifr-idl")
  +(gen-stub-file (lookup-name "CORBA") "clorb:x-ifr-base.lisp")
   
   (defvar *target* (make-instance 'code-target))
   (target-code (lookup-name "CosNaming") *target*)
  -
  -(pprint
  -(loop for sym in (slot-value *target* 'symbols)
  -      collect (cons (package-name (symbol-package sym)) (symbol-name sym))))
  -
  -(pprint (make-target-ensure-package (elt (slot-value *target* 'packages) 2) *target*))
  -
  -
  -
   |#
  
positive.code: (defclass code-target ()
    ((packages :initform nil)
     (symbols  :initform nil)
     (defs     :initform nil)))
  
  (defgeneric target-typecode (obj target)
    (:documentation 
  
negative.code:                      (op:members sdef)))))
  
  (defmethod target-code ((enum CORBA:EnumDef) target)
    (make-idltype
     (scoped-target-symbol target enum)
     (op:id enum)
     `(make-typecode :tk_enum ,(op:id enum) ,(op:name enum) ',(op:members enum))
     `(deftype ,(scoped-target-symbol target enum) ()
        '(member ,@(map 'list (lambda (name) (make-target-symbol target name :keyword))
                        (op:members enum))))))
  
  (defmethod target-code ((exc CORBA:ExceptionDef) target)
    `(define-user-exception ,(scoped-target-symbol target exc)
         :id ,(op:id exc)
         :name ,(op:name exc)
         :members ,(map 'list
                        (lambda (smember)
                          (let ((m-name (op:name smember)))
                            (list m-name (target-typecode (op:type_def smember) target))))
                        (op:members exc))))
  
  
  ;;;; Stub code generator
  