guile-devel
[Top][All Lists]
Advanced

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

Re: scm_to_pointer vs scm->pointer


From: Ludovic Courtès
Subject: Re: scm_to_pointer vs scm->pointer
Date: Tue, 03 Jul 2012 23:47:26 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux)

Heya!

Andy Wingo <address@hidden> 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 via email to

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