(defun make-part-reader (function type)
(lambda (stream echar)
(let ((part (make-instance type)))
(setf (start-position part) (file-position stream))
(funcall function stream echar)
(setf (end-position part) (file-position stream))
part)))
Source Context