unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: FFI and disjoint types
Date: Mon, 01 Mar 2010 20:49:58 +0000	[thread overview]
Message-ID: <87hbozvkax.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87sk8kgm5o.fsf@gnu.org> ("Ludovic Courtès"'s message of "Mon, 01 Mar 2010 15:18:59 +0100")

ludo@gnu.org (Ludovic Courtès) writes:

> 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?

Sounds reasonable.  Perhaps (system foreign) could add a way of
declaring foreign pointer types, and of allowing code to state the type
of a pointer at the time of boxing it.

     Neil




  reply	other threads:[~2010-03-01 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 14:18 FFI and disjoint types Ludovic Courtès
2010-03-01 20:49 ` Neil Jerram [this message]
2010-03-03 12:24 ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hbozvkax.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).