[cl-irc-devel] Feedback from a novice

Andy Hefner ahefner at gmail.com
Sat Jul 16 15:01:07 UTC 2005


On 7/15/05, Ed Symanzik <zik at msu.edu> wrote:

> Btw, I was surprized to find that the read-message method doesn't just
> read a string, parse it, and return a message; it also dispatches events.

I struggled with this aspect of cl-irc as well. I wanted a way to
handle arbitrary messages in one place without needing to define two
dozen hooks, and settled on the following solution:

1) Define no hooks.
2) Define a subclass of connection for your app with its own method on
read-message, as follows:

(defclass weird-connection (connection) ())

(defmethod read-message ((connection weird-connection))
  (let ((message (call-next-method)))    
    ;; ** Do something with the message here **
    message))



More information about the cl-irc-devel mailing list