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

How do I make some other function call the next method?



I don't know if it's possible or reasonable to do the following.  I am
trying to implement telnet-streams (which respond to and filter out IAC
seqeunces, etc) on top of tcp-streams.  I already have a routine
(parse-stream) which will filter out junk and return a character, so I did
this:

(defmethod stream-tyi ((stream telnet-stream))
  (let ((a-char nil))
    (when (listen stream)
      (setq a-char (parse-stream (coerce stream 'tcp-stream) *parse-table*
*parse-buffer*)))
    a-char))

partial code...

(defun parse-stream (stream parse-table a-buffer)
  "Will return nil or a valid item from the stream."
  (let ((a-char nil))
    (loop
     (when (null (setq a-char (ccl:stream-tyi stream)))
          (RETURN nil))
   ...do more stuff...
  )))

So, telnet-stream's stream-tyi calls parse-stream, which calls stream-tyi. 
I want it to call TCP-STREAM'S stream-tyi (- the inherited stream-tyi - the
NEXT stream-tyi).  I understand that coerce will not do the trick (it would
in Object Pascal).  Is this a sensible thing to do in CLOS architecturaly
or performance wise?  Any other ideas?
----------------------------------------
Derek White      	      (-ex Mr. Pascal)
ATG/East        	       derek@cambrige.apple.com, or DEREK on AppleLink