![](https://secure.gravatar.com/avatar/ec2fe36188a40f46952e46d6020848b8.jpg?s=120&d=mm&r=g)
16 Jul
2005
16 Jul
'05
3:01 p.m.
On 7/15/05, Ed Symanzik <zik@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))