On Mon Oct 20, 2025 at 9:58 PM CEST, Diogo wrote:
>
> I will try this. By intended style, you mean crunching small pieces of
> code in a larger chicken program/module?

This is the way I considered, but you're use is not wrong as such,
I just didn't test that way of usage well enough, it turns out.
Both approaches should work, of course.

>
> Probably I am stretching crunch beyond its intended use. This demo
> project has a few crunch modules such as ps2-decoder, matrix-scanner,
> usb-serial, etc for a microcontroller firmware. The modules are
> defined in separate files and imported in a main.scm, which again
> is a crunch program. All compiles ok. No chicken, only crunch.

That's just how it is intended to be used.

>
> Most modules can also be compiled to the host architecture (amd64)
> and I wanted to test them there.  The intent of importing crunch
> modules in chicken was to have some nice unit testing.

Indeed, that should be possible also, since CRUNCH goes to some length
of making the code (at least appear to be) compatible to CHICKEN
code.

>
> Alternatively, I could split the modules in implementation (.scm)
> and module definition (.sld) and include the former in the latter.
> Then in the chicken tests, I could  (crunch (include "former.scm")).
> Not sure if that would help though. What would be your recommendation?

It's certainly one way to approach it. In the end it depends on what
is most convenient to you. I will investigate the problem you reported
in any case, I'm just a bit busy in the moment, so it may take some
time.


cheers,
felix


Reply via email to