jaeheum / qzmq

qzmq provides Q bindings for CZMQ, the high-level C binding for ØMQ
Mozilla Public License 2.0
22 stars 7 forks source link

Trailing semicolon after zsocket.bind call results in failure #12

Closed altenmueller closed 11 years ago

altenmueller commented 11 years ago

Consider the following trivial example:

\l qzmq.q

ctx:zctx.new[]
socket:zsocket.new[ctx; zmq`DEALER]
zsocket.bind[socket; `$"tcp://*:9001"]
zsocket.destroy[ctx; socket]
zctx.destroy[ctx]
\\

This works fine, and you will see the port number printed out to the q console which indicates that the port bound properly. Now notice if you add a semicolon after the bind line:

\l qzmq.q

ctx:zctx.new[]
socket:zsocket.new[ctx; zmq`DEALER]
zsocket.bind[socket; `$"tcp://*:9001"];
zsocket.destroy[ctx; socket]
zctx.destroy[ctx]
\\

Now the bind does not occur. I'm still pretty new to q, but as far as I can tell semicolons shouldn't affect the calls of functions.

BTW this is KDB+ 2.7 2011.03.23 if that helps at all.

jaeheum commented 11 years ago

The trailing semicolon is suppressing the output to the console? See q)port:zsocket.bind[socket; `$"tcp://*:9001"]; q)port 9001i q)

Kdb+ 2.8 is the earliest version tried and it'll be soon marked unsupported as everything will move to 3.0 or above. Sorry don't have 2.7 to try out.

altenmueller commented 11 years ago

Ah, my bad. You are correct. My apologies.