[Ecls-list] C:MAKE-BUILD composition and hierarchical ar shrink-wrapping
Juan Jose Garcia-Ripoll
jjgarcia at users.sourceforge.net
Sat Apr 5 19:52:03 UTC 2008
On Tue, Apr 1, 2008 at 2:15 PM, Samium Gromoff
<_deepfire at feelingofgreen.ru> wrote:
> Let me illustrate it:
>
> foo.lisp: ======= 8< =======
>
> (ffi:def-function "a"
> ()
> :returning :void)
This can't definitely work. What you are defining here is a lisp
function that will call a C function with name "a". This function is
defined nowhere. Hence, when you build the fasl file, it simply fails.
Instead, the following works:
foo.lisp: ===============
(ffi:def-function "a"
()
:returning :void)
(eval-when (:load-toplevel)
(ffi:clines "
void a() {
printf(\"Hola\\\n\");
}
")
)
======================
Following the same steps as you, and then entering ECL:
$ ecl
ECL (Embeddable Common-Lisp) 0.9j (CVS 2008-03-17 17:51)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help. Top level.
> (load "foo")
;;; Loading #P"/Users/jjgarcia/src/common-lisp.net/ecl/foo.fas"
#P"/Users/jjgarcia/src/common-lisp.net/ecl/foo.fas"
> (load "foo2")
;;; Loading #P"/Users/jjgarcia/src/common-lisp.net/ecl/foo2.lisp"
#P"/Users/jjgarcia/src/common-lisp.net/ecl/foo2.lisp"
> (b)
Hola
NIL
>
Juanjo
--
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
http://juanjose.garciaripoll.googlepages.com
More information about the ecl-devel
mailing list