unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* FFI and disjoint types
@ 2010-03-01 14:18 Ludovic Courtès
  2010-03-01 20:49 ` Neil Jerram
  2010-03-03 12:24 ` Andy Wingo
  0 siblings, 2 replies; 3+ messages in thread
From: Ludovic Courtès @ 2010-03-01 14:18 UTC (permalink / raw)
  To: guile-devel

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’.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-03 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01 14:18 FFI and disjoint types Ludovic Courtès
2010-03-01 20:49 ` Neil Jerram
2010-03-03 12:24 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).