+ (:file-position
+ (let ((buffer (fill-pointer-output-stream-string stream)))
+ (if arg1
+ (setf (fill-pointer buffer)
+ (case arg1
+ (:start 0)
+ ;; Fill-pointer is always at fill-pointer we will
+ ;; make :END move to the end of the actual string.
+ (:end (array-total-size buffer))
+ ;; We allow moving beyond the end of string if the
+ ;; string is adjustable.
+ (t (when (>= arg1 (array-total-size buffer))
+ (if (adjustable-array-p buffer)
+ (adjust-array buffer arg1)
+ (error "Cannot move FILE-POSITION beyond the end ~
+ of WITH-OUTPUT-TO-STRING stream ~
+ constructed with non-adjustable string.")))
+ arg1)))
+ (fill-pointer buffer))))