[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] callbacks from C into Scheme
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] callbacks from C into Scheme |
Date: |
Thu, 20 Mar 2008 10:36:00 +0100 |
On Thu, Mar 20, 2008 at 6:51 AM, Shawn Rutledge
<address@hidden> wrote:
> This is intended to wrap a given Scheme callback as a C function, and
> make some C library calls, then under the right conditions, call the
> wrapped callback. After several sessions of staring at it, I still
> don't understand why this doesn't work. Probably missing something
> stupid though.
>
That could be called a compiler bug, actually. Moving the define-external
form to toplevel will work. The optimizer removes the "msg" argument
(since it is not used) but can't (obviously) adjust calls from C to respect
that optimization. Since toplevel procedures can not be optimized in
such a way (the call sites are unknown), the optimization does not
apply.
I have added a note in the trunk manual.
cheers,
felix