[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: support for partial messages (i.e. chained diagnostics)
From: |
Alexandre Duret-Lutz |
Subject: |
Re: FYI: support for partial messages (i.e. chained diagnostics) |
Date: |
08 Oct 2002 20:12:49 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
>>> "Akim" == Akim Demaille <address@hidden> writes:
Akim> how about having `msg' and the like return an object
Akim> message, and have a means to extend a message object?
Akim> my $msg = new msg;
Akim> $msg->msg 'channel', 'foo:3', 'redefinition of A ...';
Akim> $msg->msg 'channel', 'foo:1', '... A previously defined here';
Akim> Which would be equivalent to (but nicer than):
Akim> my $msg = msg 'channel', 'foo:3', 'redefinition of A ...';
Akim> $msg->msg 'channel', 'foo:1', '... A previously defined here';
In both cases, you also need a way to indicate when the message
is terminated and should be sent. E.g. $msg->finish.
If you want `msg' to construct a new object, as in your second
example, then you will also have to call ->finish on complete
messages (because `msg' doesn't know it's complete):
msg ('channel', 'foo:3', 'random error')->finish;
I'm not really fond of this :)
I agree we could have message objects _in addition_ to the
present `msg' function. As you say this would avoid the
$partial buffer. But IMO that requires some additional
machinery we don't need at the moment. (Maybe the day
Channel.pm is used in a multithreaded program?)
--
Alexandre Duret-Lutz