8 May 2003 14:48
Re: defentry problems [0.9]
[Sorry for this late answer, but I am right now in another conference with very limited access to mail.] My excuse: this problem with DEFENTRY was reported long ago, but it was not done as a bug report in sourceforge, and therefore I forgotted itThe cause: DEFENTRY and DEFCFUN were commented out in the original release of ECL. I did not uncomment them, because there were some things which bothered me: for instance, passing strings was made by simply giving the C routine access to the data inside the lisp string, without copying, or any other security measure. This inherent insecurity, made me intentionally forget DEFENTRY. However, I now believe that it is the user's responsibility to deal with these problems (Interfacing to C is an ugly business anyway, it is normally done by moderately clever and responsible people
. Therefore, and to solve the problem that my UFFI-compatible FFI is not finished, I will submit ASAP a patch which reactivates DEFENTRY. BTW, the same business may be achieved with DEFCBODY (Which is also unsafe). Just look at the manual. Best regards, Juanjo ----- Mensaje Original ----- Remitente: Stig E Sandoe <stig <at> langband.org> Fecha: Lunes, Mayo 5, 2003 12:27 pm Asunto: [Ecls-list] defentry problems [0.9] > hei, > > I tried to get ffi working with ECL but I seem unable to get it > working. I follow the example in the docs: > > kb.lsp: > ------ > (in-package :cl-user) > > (clines " > int buffy(int val) > return val + val; > } > ") > > (ffi:defentry buffy (ffi:int) (ffi:int "buffy")) > > ----- > > The interpreter stumbles on it, so I tried to compile it: > > $ /local/tmp/bin/ecl -compile kb.lsp > ;;; Loading "/local/tmp/lib/ecl/cmp.so" > ;;; Warning: PROCLAIM is being redefined. > ;;; Warning: COMPILE-FILE-PATHNAME is being redefined. > ;;; Warning: COMPILE-FILE is being redefined. > ;;; Warning: COMPILE is being redefined. > ;;; Warning: DISASSEMBLE is being redefined. > ;;; Warning: WITH-COMPILATION-UNIT is being redefined. > ;;; Compiling kb.lsp. > ;;; Compiling (FFI:DEFENTRY BUFFY ...). > ;;; The macro form (FFI:DEFENTRY ...) was not expanded successfully. > ;;; You are recommended to compile again. > ... > > > So how can I make ECL call C-code (both inline and in other > libraries)? > (System: Debian Linux/x86, 2.4.20, glibc2.3, ECL v0.9 from source) > > -- > ------------------------------------------------------------------ > Stig E. Sandø stig <at> langband.org http://www.langband.org/ > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Ecls-list mailing list > Ecls-list <at> lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ecls-list > ------------------------------------------------------- Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara The only event dedicated to issues related to Linux enterprise solutions www.enterpriselinuxforum.com
The cause: DEFENTRY and DEFCFUN were commented out in the original
release of ECL. I did not uncomment them, because there were some
things which bothered me: for instance, passing strings was made by
simply giving the C routine access to the data inside the lisp string,
without copying, or any other security measure.
This inherent insecurity, made me intentionally forget DEFENTRY.
However, I now believe that it is the user's responsibility to deal
with these problems (Interfacing to C is an ugly business anyway, it
is normally done by moderately clever and responsible people
RSS Feed