Hi guys,

I'd like to give a short status-update on the issue. Based on the feedback
on this thread and #chicken, the original plan was to patch up chicken-core
to support struct-by-val argument- and return-type passing.

This turned out to be very complex indeed. It's unclear of how to represent
these structs on the scheme-side. The easiest solution would be to
represent the struct with a blob. One problem here though is that it can't
be used on the scheme-side itself. This would give the struct-by-value
feature questionable usefulness.

On the other hand, the ideal struct representation on the scheme-side
should be some sort of record with slots corresponding to the struct
fields. That in turn requires giving the struct definition to chicken,
where the blob would otherwise only need the size. This involves complexity
levels I cannot pinpoint, but it's probably the reason this feature isn't
there in the first place!

I am therefore going to give plan B an attempt: modify chicken-bind instead
of chicken-core, and let it generate foreign struct-by-value wrappers.

Wish me luck fellas, and thanks for everyone's support on #chicken!
K.

On Wed, Feb 29, 2012 at 5:44 PM, Moritz Heidkamp <mor...@twoticketsplease.de
> wrote:

> Kristian Lein-Mathisen <kristianl...@gmail.com> writes:
>
> > Any thoughts on how to pursue this?
>
> Another option would be to create a module which re-exports all
> `foreign' syntax wrapped with support for structs-by-value. Then just
> import your wrapper module instead of `foreign' in the code generated by
> `chicken-bind'.
>
> Moritz
>
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to