On Fri, Dec 08, 2006 at 09:09:38AM +0000, Luís Oliveira wrote:
On 12/6/06, Stelian Ionescu stelian.ionescu-zeus@poste.it wrote:
(defun %load-foreign-library (name) "Load the foreign library NAME."
- (sys::load-object-file name))
- (or (sys::load-object-file name)
t))
Hmm, that way %LOAD-FOREIGN-LIBRARY will never return NIL, even when loading the library really fails. We should be detecting if the foreign library is already loaded, and we should probably keep track
check this new patch
of this in the portable side of things. That's needed for
I'm not sure this can be done reliably, imagine for instance that someone may load libraries in their initialization file *before* loading cffi which would lead to incongruities between the lisp implementation and cffi; we should see first how many of the supported implementations have a means to see which foreign libraries have been loaded. on CMUCL there's SYS::*GLOBAL-TABLE*, on SBCL there's SB-ALIEN::*SHARED-OBJECTS* but I don't know about the others
UNLOAD-FOREIGN-LIBRARY too, it's in the TODO list I think.
You're welcome to tackle that TODO item. :-)
I'll see what I can do