Newsgroups: comp.lang.lisp
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!m.cs.uiuc.edu!sudha
From: sudha@herodotus.cs.uiuc.edu (Sudhakar Yerramareddy)
Subject: passing Lisp functions to C
Message-ID: <sudha.672658705@milton>
Sender: news@m.cs.uiuc.edu (News Database (admin-Mike Schwager))
Nntp-Posting-Host: milton.cs.uiuc.edu
Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL
Date: 26 Apr 91 09:38:25 GMT
Lines: 30

I am calling a C function c_function from LISP.  The c_function has the
following declarations:

void c_function(a,b,func)
float *a,*b;
float (*func)();

I use:

(def-foreign-function (lisp-function (:return-type :null)
				     (:name "c_function")
				     (:language :c))
  (a (:pointer :single-float))
  (b (:pointer :single-float))
  (func *what-should-be-here?* ))


I create a function #'run-time-function at run-time.  I want this function
to be passed as the third argument to the c_function (via lisp-function).

My call looks like this:

(lisp-function pointer-a pointer-b *what-should-be-here?*)

I am using Lucid Common Lisp.  How do I do this?  Any suggestions
appreciated.

Thanks.
-- sudhakar

