From: Damond Walker
Subject: Clisp native code interface?
Date: 
Message-ID: <%m4m3.100$hr1.15630@typhoon2.gnilink.net>
    Can anyone point me to an example of using native (non-lisp) libraries
from within clisp?  Say, for example, I want to use Curses a database
library?


                            Damo

From: Bruno Haible
Subject: Re: Clisp native code interface?
Date: 
Message-ID: <7nigm8$c6i$1@news.u-bordeaux.fr>
Damond Walker <·······@iximd.com> wrote:
>    Can anyone point me to an example of using native (non-lisp) libraries
> from within clisp?  Say, for example, I want to use Curses a database
> library?

Look in the `modules' directory of the clisp source. There are bindings
for regexp, wildcard matching, and PostgreSQL, among others.

             Bruno                                 http://clisp.cons.org/
From: Damond Walker
Subject: Re: Clisp native code interface?
Date: 
Message-ID: <Ul6n3.283$hr1.59820@typhoon2.gnilink.net>
Bruno Haible wrote in message <············@news.u-bordeaux.fr>...
>
>Look in the `modules' directory of the clisp source. There are bindings
>for regexp, wildcard matching, and PostgreSQL, among others.
>


    Thank you.  Do modules have to be compiled into clisp itself or can they
be linked dynamically when needed by lisp code?

                            Damond
From: Bruno Haible
Subject: Re: Clisp native code interface?
Date: 
Message-ID: <7nk49f$sb0$1@news.u-bordeaux.fr>
Damond Walker <·······@iximd.com> asked about CLISP:
>
>   Do modules have to be compiled into clisp itself or can they
> be linked dynamically when needed by lisp code?

Pure dynamic linking is not available now, because we haven't resolved the
problems related to unloading of dynamically loaded modules.

But:
  - A module can be developed and compiled without access to the clisp sources.
    CLISP binaries are sufficient. (Although I recommend looking at the
    sources.)
  - You can launch a new session of clisp with additional modules.
      $ clisp-link run /usr/local/lib/clisp/base module1 module2 ...
  - You can also create an executable and memory image of clisp with
    additional modules.
      $ clisp-link add-module-sets /usr/local/lib/clisp/base destdir \
                   module1 module2 ...

               Bruno                          http://clisp.cons.org/
From: Eric Marsden
Subject: Re: Clisp native code interface?
Date: 
Message-ID: <wzilnc3d4la.fsf@mail.dotcom.fr>
>>>>> "dw" == Damond Walker <·······@iximd.com> writes:

  dw> Can anyone point me to an example of using native (non-lisp)
  dw> libraries from within clisp? Say, for example, I want to use
  dw> Curses a database library?

It is not clear to me whether by "Clisp" you mean Common Lisp in
general, or the CLISP implementation of Common Lisp.

You should look though your implementation's documentation for the
keywords "Foreign function Interface", or FFI. The details will be
implementation- and platform-specific. The CLISP FFI is documented in
its implementation notes; it requires you to link (statically) with
the foreign code. There is some experimental code for dynamic linking
with shared libraries from CLISP at

   <URL:http://www.chez.com/emarsden/downloads/dl0.1.tar.gz>

   
There is a partially completed interface to curses for CMUCL at

   <URL:http://sanpietro.red-bean.com/~craig/curl/>
   
-- 
Eric Marsden
It's elephants all the way down