anchor.diff:  ;;;; GIOP extras
   
   (defun marshal-giop-set-message-length (buffer)
  -  (let ((len (fill-pointer (buffer-octets buffer))))
  -    (setf (fill-pointer (buffer-octets buffer)) 8)
  -    (marshal-ulong (- len 12) buffer)
  -    (setf (fill-pointer (buffer-octets buffer)) len)))
  +  (with-out-buffer (buffer)
  +    (let ((len pos))
  +      (setf pos 8)
  +      (marshal-ulong (- len 12) buffer)
  +      (setf pos len))))
   
   
   (defun marshal-service-context (ctx buffer)
  
positive.code: (defgeneric marshal (arg tc buffer))
  
  (defmethod marshal (arg (type CORBA:TypeCode) buffer)
    (let ((kind (typecode-kind type))
          (params (typecode-params type)))
      (ecase kind
        ((:tk_any) (marshal-any arg buffer))
        ((:tk_octet) (marshal-octet arg buffer))
        ((:tk_char) (marshal-octet (char-code arg) buffer))
        ((:tk_boolean) (marshal-bool arg buffer))
        ((:tk_ushort :tk_short) (marshal-ushort arg buffer))
        ((:tk_ulong) (marshal-ulong arg buffer))
        ((:tk_long) (marshal-long arg buffer))
        ((:tk_enum) (marshal-enum arg type buffer))
        ((:tk_longlong :tk_ulonglong) (marshal-number arg 8 buffer))
        ((:tk_float) (marshal-float arg buffer))
        ((:tk_double) (marshal-double arg buffer))
        ((:tk_longdouble) (marshal-longdouble arg buffer))
        ((:tk_string) (marshal-string arg buffer))
        ((:tk_objref object) (marshal-object arg buffer))
        ((:tk_alias) (marshal arg (third params) buffer))
        ((:tk_typecode) (marshal-typecode arg buffer))
        ((:tk_null))
        ((:tk_sequence)
         (let ((el_type (first params)))
           (marshal-sequence
            arg 
            (lambda (arg buffer) (marshal arg el_type buffer)) 
            buffer)))
        ((:tk_array)
         (let ((tc (first params))
               (len (second params)))
           (unless (= len (length arg))
             (error 'CORBA:MARSHAL))
           (doseq (el arg) (marshal el tc buffer)))))))
  
  (defun marshal-multiple (values types buffer)
    (loop for val in values
  
negative.code:     (marshal-typecode tc buffer)
      (marshal (any-value arg) tc buffer)))
  
   
  
  
  
  