[zeromq-dev] zmq_version

Peter Busser busserpeter at gmail.com
Wed Jan 27 15:25:44 CET 2010


Hi,

I appreciate that there are libraries which provide a version as a C
macro. But as I have described on the dev mailing list, the Common
Lisp CFFI foreign function interface doesn't use header files. The
whole interface is specified in Lisp. In other words, not a single
line of C code is compiled. Therefore macros aren't very effective for
as far as the CL interface is concerned.

Don't forget that a macro provides information about the version at
compile time, not at run-time.

My suggestion is to have three functions, one to get the major version
number, one to get the minor version number, and one for the
update/patch level. These functions can return values defined by C
macros. They take up very little space. And since they are normally
used only once, it doesn't matter at all whether they take more cycles
than a macro.

However, a function returning a string would be fine too. The Lisp
programmer can then break up the string in parts or do whatever he
seems fit.

A short web page which provides an overview of the ideas behind CFFI
can be found here:
http://common-lisp.net/project/cffi/manual/html_node/Tutorial_002dComparison.html

Groetjes,
Peter.



More information about the zeromq-dev mailing list