librelist archives

« back to archive

Side-effects free

Side-effects free

From:
Paolo Redaelli
Date:
2012-02-18 @ 22:11
I'm updating ømq wrappers; I read in the latest zmq_send man page:
The zmq_msg_t structure passed to zmq_send() is nullified during the
call. If you want to send the same message to multiple sockets you have
to copy it using (e.g. using zmq_msg_copy()).

I was going to wrap it in ZMQ_SOCKET as feature send (a_message:
ZMQ_MESSAGE)
Now shall the Eiffel wrapper maintain the low-level C behaviour,
"destroying" the content of `a_message' or on the behalf of
side-effect-free computing I shall give zmq_send a copy of a message?
I mean, when we say that we would like side-effects-free computing,
expecially in Eiffel are we referring only to queries or also to commands?

Cheers
    Paolo

Re: [libertyeiffel] Side-effects free

From:
Paolo Redaelli
Date:
2012-02-18 @ 22:20
Il 18/02/2012 23:11, Paolo Redaelli ha scritto:
> I'm updating ømq wrappers; I read in the latest zmq_send man page:
> The zmq_msg_t structure passed to zmq_send() is nullified during the
> call. If you want to send the same message to multiple sockets you
> have to copy it using (e.g. using zmq_msg_copy()).
>
> I was going to wrap it in ZMQ_SOCKET as feature send (a_message:
> ZMQ_MESSAGE)
> Now shall the Eiffel wrapper maintain the low-level C behaviour,
> "destroying" the content of `a_message' or on the behalf of
> side-effect-free computing I shall give zmq_send a copy of a message?
> I mean, when we say that we would like side-effects-free computing,
> expecially in Eiffel are we referring only to queries or also to commands?
Pardon I answer to myself. AFAIK ZMQ_SOCKET.send (a_message:
ZMQ_MESSAGE) is actually allowed to change a_message under the
query-command separation principle, at least according to
http://en.wikipedia.org/wiki/Command-query_separation
I'll have to dig my OOSC copy to investigate about it....

 
 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP
autenticato? GRATIS solo con Email.it http://www.email.it/f
 
 Sponsor:
 Riccione, prenota prima per spendere meno a Pasqua all'Hotel Aquila 
d'Oro, Offerte da 3 e 4 giorni, a partire da Euro 165 a persona in 
pensione completa + bevande
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=12137&d=18-2