[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

byte-stream-with-mark



I think my last message may have gotten lost during last week's
infection.

The problem is that I use the :listen method on an object of flavor
neti:buffered-stream-with-mark.  I noticed behavior that could only
happen if the stream was dropping marks.  It turns out that this flavor
uses the default listen method:

(DEFMETHOD (:LISTEN BASIC-BUFFERED-INPUT-STREAM :DEFAULT) ()
  (CONDITION-CASE ()
      (MULTIPLE-VALUE-BIND (BUFFER AT-EOF)
	  (SEND SELF :SETUP-NEXT-INPUT-BUFFER T NIL)
	(OR (NOT (NULL BUFFER)) AT-EOF))
    (ERROR T)))

Which easily explains dropped marks.  I defined a listen method that
fixed the problem:

(defmethod (:listen buffered-stream-with-mark) ()
  (condition-case ()
       (when (send raw-stream :read-input-buffer "EOF - you lose" t)
	 t)	 
     (error t)))

Does this do the right thing?

Chris Maeda