Re: dereferencing C pointer at scheme level

Nala Ginrut <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <CAPjoZoc_ZKsF3yaofW5TPDr3LKVNOuPB3bdanfbgVYpDXPxTAQ@mail.gmail.com>
Hi Andy!
Short answer: dereference-pointer

Longer answer: this post may help
https://nalaginrut.com/archives/2015/03/27/do-some-quick-and-dirty-with-guile-ffi

Best regards.

On Mon, May 13, 2024, 06:53 Andy Tai <[email protected]> wrote:

> 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
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.