* scm_to_pointer vs scm->pointer
@ 2012-07-02 21:38 Andy Wingo
2012-07-03 21:47 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Andy Wingo @ 2012-07-02 21:38 UTC (permalink / raw)
To: guile-devel
Hello,
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.
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, and
that is inconsistent with scm->pointer / scm_scm_to_pointer. This
should be fixed. Otherwise it's impossible to document in any sane
fashion.
Suggestion: change scm_to_pointer to SCM_POINTER_VALUE. WDYT?
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scm_to_pointer vs scm->pointer
2012-07-02 21:38 scm_to_pointer vs scm->pointer Andy Wingo
@ 2012-07-03 21:47 ` Ludovic Courtès
2012-07-04 15:35 ` Andy Wingo
0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2012-07-03 21:47 UTC (permalink / raw)
To: guile-devel
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’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scm_to_pointer vs scm->pointer
2012-07-03 21:47 ` Ludovic Courtès
@ 2012-07-04 15:35 ` Andy Wingo
2012-07-05 16:11 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Andy Wingo @ 2012-07-04 15:35 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: Mark H. Weaver, guile-devel
On Tue 03 Jul 2012 23:47, ludo@gnu.org (Ludovic Courtès) writes:
>> 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.)
On second thought, let's leave it in. It is terribly confusing, but
alternatives are worse.
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scm_to_pointer vs scm->pointer
2012-07-04 15:35 ` Andy Wingo
@ 2012-07-05 16:11 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2012-07-05 16:11 UTC (permalink / raw)
To: Andy Wingo; +Cc: Mark H. Weaver, guile-devel
Hi,
Andy Wingo <wingo@pobox.com> skribis:
> On Tue 03 Jul 2012 23:47, ludo@gnu.org (Ludovic Courtès) writes:
>
>>> 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.)
>
> On second thought, let's leave it in. It is terribly confusing, but
> alternatives are worse.
We could also document ‘SCM_POINTER_VALUE’, WDYT?
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-05 16:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-02 21:38 scm_to_pointer vs scm->pointer Andy Wingo
2012-07-03 21:47 ` Ludovic Courtès
2012-07-04 15:35 ` Andy Wingo
2012-07-05 16:11 ` Ludovic Courtès
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).