From: Daniel B. <da...@te...> - 2000-05-17 18:37:40
|
"Raymond A. Wiker" <rw...@c2...> writes: > Given the fact that the definitions in unix.lisp are difficult > to get right, I have started thinking about generating this file > automatically (or at least semi-automatically), using a program to > read through header files and generate the appropriate lisp > definitions. Any thoughts on this? I needed to do this for my sockets library, and eventually decided on an approach that takes a data file full of sexprs specifying which values we'd like to know about, then writes out, compiles and executes a small C program that gets them. It copes with constants, #defines, enums, and structure offsets. Because it uses the system's C compiler it's as near as possible guaranteed to arrive at the same answer - parsing C from Lisp code really doesn't soud like a fun idea especially when you start looking at the hairy conditional #include mess that is /usr/include on Glibc-based systems. CVS repository (look at INSTALL, constants.ccon, defs-to-lisp.lisp and the Makefile) http://loaclhost.telent.net/cgi-bin/cvsweb/telent/sockets/ :sockets information and links to download from http://ww.telent.net/lisp/sockets.html My mk-defsystem-for-sbcl patch, if anybody else needs one, at http://ww.telent.net/lisp/defsystem-v1.12.diff > mk:defsystem has quite a few feature-tests on :cltl2, which is > predefined for CMUCL. Should this also be put on the features-list for > SBCL, or would it be better to change defsystem.lisp to use :ansi-cl > or :sbcl directly? My guess: the latter. The language specificed by cltl2 is not actually compatible with ansi cl, according to the hyperspec. -dan |