CL-USER> (ql:quickload :trivial-gray-streams) To load "trivial-gray-streams": Load 1 ASDF system: trivial-gray-streams ; Loading "trivial-gray-streams" (:TRIVIAL-GRAY-STREAMS) CL-USER> (defclass transform-stream (trivial-gray-streams:fundamental-character-output-stream) ((target :reader target :initarg :target))) # CL-USER> (defmethod trivial-gray-streams:stream-write-char ((stream transform-stream) char) (write-char (if (char= char #\_) #\a char) (target stream))) # CL-USER> (defvar a (make-instance 'transform-stream :target *standard-output*)) A CL-USER> (write-line "wibble_bar_quux") wibble_bar_quux "wibble_bar_quux" CL-USER> (write-line "wibble_bar_quux" a) wibbleabaraquux "wibble_bar_quux" CL-USER>