On Sat, Dec 13, 2025 at 03:41:57PM +0100, Felix Winkelmann wrote:
> On Fri Dec 12, 2025 at 8:34 AM CET, Diogo via Chicken-users wrote:
> It turns out function-type arguments are not handled yet by the wrapper
> generation code, I've added this (see git repo). But note that your
> examples won't work, as you pass Scheme/CHICKEN procedures ("impl")
> to CRUNCHed code, since the "impl" represents the wrapper, not
> the raw function pointer.

Thanks for that. I will give a try right away. It is possible to "derefence"
the impl wrapper so that I could achieve this selection of behavior from the
chicken side?

To exemplify the whole issue, I am testing a crunch procedure

        scan-matrix(m, read-col)

Where m is "matrix" object in crunch that represents a keyboard and "real-col"
is a procedure which reads the state of one keyboard column and returns it
encoded in some byte. When running this on a microcontroller, I want to use
real-col that uses quite platform specific functionality which I cannot compile
when testing this on the host. On the host, I want to create a "mock" read-col
in crunch, and then use chicken to call scan-matrix  with that mock read-col and
then evaluate the results among other things.

Do you have another/better suggestion how I could replace the functionality
inside a crunch module that is called from chicken?

Best,
-Diogo

Reply via email to