chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] the (##sys#call-host) FFI trick


From: Daniel B. Faken
Subject: Re: [Chicken-users] the (##sys#call-host) FFI trick
Date: Wed, 27 Jul 2005 17:28:05 -0400 (EDT)

On Wed, 27 Jul 2005, Daniel B. Faken wrote:
> Hello,
> 
>   I've been trying out the trick we discussed 
> (http://lists.gnu.org/archive/html/chicken-users/2005-07/msg00077.html), 
> but having confusing issues.  I just thought I would report on these..
[...]
> 
> Oh, one more thing I tried: [...]

-- and wouldn't you know it, the very next thing I tried worked!
Well, kind of.

If I use (foreign-primitive ..) instead of (foreign-safe-lambda* ..), 
the crashing goes away..

  I say this "kind of works", because for me it begs the question of why 
foreign-lambda* doesn't work: is there a bug in it?  Is there a bug in my 
program that somehow ignored by foreign-primitive?  (will it crash 
unpredictably sometime in the future? :)

  One of the reasons I tried this in the first place was that I traced
some errors to the continuation, and foreign-primitive "calls the 
continuation directly".  But I'm not sure what that means for my 
functions, which just take a (struct *) and some standard OpenGL args as 
parameters, and calls a C function in the structure..
(i.e., even though I was using foreign-safe-lambda*, these functions 
weren't actually calling back into Scheme).
  They also don't allocate or even use any scheme-data types..

Anyway, this hopefully can at least shed some light on this interface.

cheers,
Daniel Faken






reply via email to

[Prev in Thread] Current Thread [Next in Thread]