unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: scm_to_pointer vs scm->pointer
Date: Tue, 03 Jul 2012 23:47:26 +0200	[thread overview]
Message-ID: <871uksms9d.fsf@gnu.org> (raw)
In-Reply-To: 871uktsv1n.fsf@pobox.com

Heya!

Andy Wingo <wingo@pobox.com> skribis:

> scm->pointer takes a Scheme value and returns a Scheme value which is a
> foreign pointer to the Scheme value.  It has been in Guile since 2.0 I
> think.

v2.0.0-105-g148c331, apparently.

> scm_to_pointer takes a Scheme value which is a foreign pointer, and
> unpacks that foregin pointer as a void*.
>
> scm_to_pointer is a new interface in master that is not in 2.0.5,

Yes.  ‘scm_from_pointer’ is pre-2.0.0.

> and that is inconsistent with scm->pointer / scm_scm_to_pointer.

Yes, but it’s consistent with the other scm_{to,from} functions.

> This should be fixed.  Otherwise it's impossible to document in any
> sane fashion.
>
> Suggestion: change scm_to_pointer to SCM_POINTER_VALUE.  WDYT?

I’m happy with this change.  Mark?

(Back then, I was skeptical about the usefulness of the C pointer API.
I have since used ‘SCM_POINTER_VALUE’ and ‘scm_from_pointer’ in
Guile-GCC, which uses a mixed dynamic/static FFI, and for good reasons.)

Thanks,
Ludo’.




  reply	other threads:[~2012-07-03 21:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 21:38 scm_to_pointer vs scm->pointer Andy Wingo
2012-07-03 21:47 ` Ludovic Courtès [this message]
2012-07-04 15:35   ` Andy Wingo
2012-07-05 16:11     ` Ludovic Courtès

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=871uksms9d.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@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).