From: "Kjetil S. Matheussen" <k.s.matheussen@notam02.no>
To: guile-devel@gnu.org
Subject: Re: Passing C pointers through guile
Date: Fri, 11 Jul 2008 19:22:32 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0807111913421.5259@ttleush> (raw)
In-Reply-To: <cmu-lmtpd-26382-1215792388-9@mail-imap1.uio.no>
Ludovic Court?s:
> "Kjetil S. Matheussen" <k.s.matheussen@notam02.no> writes:
>
>> The code in question doesn't run on those platforms anyway,
>> since there's a lot of strict linux stuff.
>
> You are certainly aware that GNU/Linux *is* available on sparc64, alpha,
> etc.
>
Well, yes, but he wrote windows 64, sparc64, alpha etc.
>> However, I don't the storage of pointers in unsigned longs (which is a
>> perfectly legal thing to do if done correctly), would pose any problem
>> for running it on other hardware.
>
> Again, it's not "perfectly legal", no matter whether you do it
> "correctly" (whatever that means) or not: the C standard makes no
> provision regarding the size of `long' versus the size of pointer types.
> It happens to work on the mainstream platforms you're using, but it's
> definitely not portable.
>
> And I suppose that's the reason why you want `scm_{to,from}_uintptr ()'
> in the first place, otherwise you'd just live (dangerously) with
> `scm_{to,from}_unsigned_long ()'.
>
Yes, and this is a stupid discussion. We don't really disagree about
anything unless anyone thinks I should change all my code using
scheme numbers to hold pointers into SMOB's, which would significantly
increase the code size which further would increase the chance of bugs.
There are, as I have given examples of already, types of pointer
where SMOB's are overkill. And just for trying out smaller things,
it a lot of work to set up all that SMOB code (again!). I do a lot
of interaction between C and scheme, and avoiding SMOBs as much
as possible saves me a lot of time.
next parent reply other threads:[~2008-07-11 17:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cmu-lmtpd-26382-1215792388-9@mail-imap1.uio.no>
2008-07-11 17:22 ` Kjetil S. Matheussen [this message]
2008-07-10 12:49 Passing C pointers through guile Kjetil S. Matheussen
2008-07-10 13:01 ` Ludovic Courtès
-- strict thread matches above, loose matches on Subject: below --
2008-07-09 20:09 Kjetil S. Matheussen
2008-07-09 20:43 ` Ludovic Courtès
2008-07-11 13:05 ` Greg Troxel
2008-07-11 13:12 ` Kjetil S. Matheussen
2008-07-11 14:42 ` Ludovic Courtès
2008-07-09 19:58 Kjetil S. Matheussen
[not found] <cmu-lmtpd-29205-1215446748-1@mail-imap1.uio.no>
2008-07-09 16:50 ` Kjetil S. Matheussen
2008-07-09 18:32 ` Kjetil S. Matheussen
2008-07-09 19:37 ` Ludovic Courtès
2008-07-09 19:35 ` 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=Pine.LNX.4.64.0807111913421.5259@ttleush \
--to=k.s.matheussen@notam02.no \
--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).