From: Andy Tai <atai@atai.org>
To: guile-user@gnu.org
Subject: dereferencing C pointer at scheme level
Date: Sun, 12 May 2024 14:52:31 -0700 [thread overview]
Message-ID: <CAJsg1E9WdSeYWYaaOgXJmd0bB8KCs_HdtGkAKCuQMKQS6WLZ5g@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 21:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-12 21:52 Andy Tai [this message]
2024-05-13 0:14 ` dereferencing C pointer at scheme level Nala Ginrut
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=CAJsg1E9WdSeYWYaaOgXJmd0bB8KCs_HdtGkAKCuQMKQS6WLZ5g@mail.gmail.com \
--to=atai@atai.org \
--cc=guile-user@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).