Nicolas Neuss <[EMAIL PROTECTED]> writes: > I have looked at the code, but I fear that I do not have the necessary > persistence. Nevertheless, I think that this project is very important, > because easy interfacing with other languages, especially C, will be a > crucial point if CL should ever become more popular again. In this > direction: couldn't the #_ macro automatically convert strings, fixnums, > etc automatically to their C representation?
There's a #$ macro to refer to C constants. Those constants are either enums or constants derived from cpp macros. E.g. if a header file contains something like #define foo (1<<3) than you can write in lisp #$foo to the get the value 8. The automatic conversion of cpp macros is quite difficult. OpenMCL has a parser and evaluator that is good enough for simple C expressions. The parser has access to the type definitions, so it can evaluate sizeof expressions. But it doesn't convert macros with arguments like WEXITSTATUS(). I didn't port the parser, I generate a small C++ program, compile it, and execute it. If that fails, the constant is not defined. Helmut.
