anchor.diff:    encoding function is used outside the dynamic context of a
     WITH-OUTPUT or WITH-OUTPUT-TO-STRING* body."))
   
  -(defmacro with-aggregate ((begin-char end-char) &body body)
  +(defmacro with-aggregate/stream ((begin-char end-char) &body body)
  +  "Set up context for aggregate serialization for the stream encoder."
     `(progn
        (unless (boundp '*json-output*)
          (error 'no-json-output-context))
        (when (stack *json-output*)
          (next-aggregate-element))
  -     (write-char ,begin-char (output-stream *json-output*))
  +     (write-indentation *json-output*)
  +     (write-delimiter ,begin-char *json-output*)
  +     (change-indentation *json-output* #'+)
        (push nil (stack *json-output*))
        (prog1
            (progn ,@body)
          (pop (stack *json-output*))
  -       (write-char ,end-char (output-stream *json-output*)))))
  +       (change-indentation *json-output* #'-)
  +       (write-indentation *json-output*)
  +       (write-delimiter ,end-char *json-output*))))
   
   (defmacro with-array (() &body body)
     "Open a JSON array, then run BODY.  Inside the body,
   ENCODE-ARRAY-ELEMENT must be called to encode elements to the opened
   array.  Must be called within an existing JSON encoder context, see
   WITH-OUTPUT and WITH-OUTPUT-TO-STRING*."
  -  `(with-aggregate (#\[ #\]) ,@body))
  +  `(with-aggregate/stream (#\[ #\]) ,@body))
   
   (defmacro with-object (() &body body)
     "Open a JSON object, then run BODY.  Inside the body,
   ENCODE-OBJECT-ELEMENT or WITH-OBJECT-ELEMENT must be called to encode
   elements to the object.  Must be called within an existing JSON
   encoder context, see WITH-OUTPUT and WITH-OUTPUT-TO-STRING*."
  -  `(with-aggregate (#\{ #\}) ,@body))
  +  `(with-aggregate/stream (#\{ #\}) ,@body))
   
   (defun encode-array-element (object)
     "Encode OBJECT as next array element to the last JSON array opened
  
positive.code: ENCODE generic function, so it must be of a type for which an ENCODE
  method is defined."
    (next-aggregate-element)
    (encode object (output-stream *json-output*)))
  
  (defun encode-array-elements (&rest objects)
  
negative.code: encoded using the ENCODE generic function, so they both must be of a
  type for which an ENCODE method is defined."
    (next-aggregate-element)
    (write-indentation *json-output*)
    (encode-key/value key value (output-stream *json-output*))
    value)
  
  