guile-devel
[Top][All Lists]
Advanced

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

FFI and disjoint types


From: Ludovic Courtès
Subject: FFI and disjoint types
Date: Mon, 01 Mar 2010 15:18:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello,

The nice thing about SMOBs is that they allow disjoint C types to be
mapped to disjoint Scheme types.

With ‘(system foreign)’, C pointers are mapped to Scheme foreign
objects, regardless of the type of object pointed to.  Thus, to get
disjoint types in Scheme, foreign objects would need to be boxed in
structs (since structs are the only way to create disjoint types from
Scheme).

If this analysis is correct, the resulting code may be somewhat
inefficient since we end up boxing C pointers twice.

Is this correct?  Thoughts?

Thanks,
Ludo’.





reply via email to

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