From: Andy Tai <atai@atai.org>
To: help-guix@gnu.org
Subject: dereferencing C pointer at scheme level
Date: Sun, 12 May 2024 11:51:17 -0700 [thread overview]
Message-ID: <CAJsg1E8OaBm5XttQQF95W96hBVLMkNc4mg+cvfdy_FsxFMYs+A@mail.gmail.com> (raw)
Hi, a question on access to C pointer in scheme:
if a C function returning a pointer is wrapped and accessed from scheme code,
int64_t * func() {
int64_t *p = make_new_pointer();
*p = // something
return p;
}
in scheme (GNU guile)
(set! p (func))
it is possible to see that p is now a pointer. How to dereference the
pointer to get the value it points to, in guile, on the scheme side?
Thanks
next reply other threads:[~2024-05-12 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-12 18:51 Andy Tai [this message]
2024-05-12 21:53 ` dereferencing C pointer at scheme level Andy Tai
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://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJsg1E8OaBm5XttQQF95W96hBVLMkNc4mg+cvfdy_FsxFMYs+A@mail.gmail.com \
--to=atai@atai.org \
--cc=help-guix@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).