On 7/7/05, Raffael Cavallaro <[EMAIL PROTECTED]> wrote:
> Can someone provide me with a minimal example scheme file that shows
> proper use of foreign-lambda* or foreign-callback-lambda* or foreign-
> safe-lambda* - in other words, a scheme file that embeds c  code in
> the scheme file. Whenever I try to do this I get a linker error
> stating that the symbol in question - the name of the foreign-lambda*
> - prepended by an underscore, e.g., _foo is undefined:
> 
> /usr/bin/ld: Undefined symbols:
> _tak

I'm not exactly sure what the problem is here: is tak the name
of a Scheme procedure that you want to call? 
Here a few examples (all untested):

;;; simple use of foreign-lambda*:

(define yo
  (foreign-lambda* void ((int x))
    "printf(\"yo: %d\\n\", x);") )

(yo 33)


;;; simple use with callback:

(define-external (back) void
  (print "I'm back!") )

(define call
  (foreign-safe-lambda* void ()
    "back();") )

(call)


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to