From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: FFI supports callbacks
Date: Mon, 06 Sep 2010 14:32:23 +0200 [thread overview]
Message-ID: <8762yj59yg.fsf@gnu.org> (raw)
In-Reply-To: 87vd6jomno.fsf@newton.homeunix.net
Hi!
"Jose A. Ortega Ruiz" <jao@gnu.org> writes:
> On Sun, Sep 05 2010, Ludovic Courtès wrote:
>
>> Hi there!
>>
>> ludo@gnu.org (Ludovic Courtès) writes:
>>
>>> BTW, while we’re at it, how about make-foreign-function => pointer->procedure?
>>
>> We briefly discussed this on IRC. One issue with the
>> ‘pointer->procedure’ name is that ‘->’ procedures are most of the time
>> one-argument procedures, whereas ‘make-foreign-function’ has 3 mandatory
>> arguments.
>>
>> However, it occurred to me that what confuses me most about
>> ‘make-foreign-function’ is that it actually makes a Scheme procedure out
>> of a foreign function.
>>
>> Conversely, ‘procedure->pointer’ really makes a foreign function out of
>> a Scheme procedure.
>>
>> In addition, I like the idea of having names that show the symmetry of
>> these two procedures.
>>
>> So, what do you think? :-)
>>
>> (I’m also open to different names that aren’t confusing and show the
>> symmetry.)
>
> import-foreign-function
> export-foreign-function / export-to-foreign-function
>
> procedure-from-foreign-function / foreign-function-to-procedure
> procedure-to-foreign-function / foreign-function-from-procedure
OK. (Slightly to verbose to my taste.)
> procedure-from-foreign / foreign-to-procedure
> procedure-to-foreign / foreign-from-procedure
>
> at any rate, i find "pointer" not clear enough.
Hmm but I find ‘foreign’ as a substantive hard to parse. :-)
The object type in question is now called ‘pointer’ (it used to be
‘foreign’), hence the name. “Pointer” is meant as a synonym for
‘void *’ ans pointer objects are untyped, which may be why it seems
“vague”. But hey, the concept of pointing to the void *is* vague.
:-)
Thanks for the suggestions!
Ludo’.
next prev parent reply other threads:[~2010-09-06 12:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 14:30 FFI supports callbacks Ludovic Courtès
2010-09-03 16:51 ` Andy Wingo
2010-09-03 17:27 ` Ludovic Courtès
2010-09-05 15:10 ` Ludovic Courtès
2010-09-05 22:23 ` Jose A. Ortega Ruiz
2010-09-06 12:06 ` Andy Wingo
2010-09-07 0:30 ` Jose A. Ortega Ruiz
2010-09-07 7:38 ` Tristan Colgate
2010-09-07 12:56 ` Ludovic Courtès
2010-09-07 21:01 ` Andy Wingo
2010-09-06 12:32 ` Ludovic Courtès [this message]
2010-09-06 12:04 ` Andy Wingo
2010-09-08 16:21 ` 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=8762yj59yg.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).