Re: [racket-users] Manually create cpointer value in racket?

2020-10-07 Thread Nathaniel Griswold
Ah, that’s perfect thanks. Totally missed the miscellaneous support section.

> On Oct 7, 2020, at 4:08 PM, Matthew Flatt  wrote:
> 
> Probably you want to use `cast`. If you have an integer `addr` that
> corresponds to an address, then
> 
> (cast addr _uintptr _pointer)
> 
> casts it to a C pointer.
> 
> Matthew
> 
> At Wed, 7 Oct 2020 10:28:42 -0500, Nathaniel Griswold wrote:
>> Related to a question I asked earlier, but this time at the racket side:
>> 
>> Is there any way to manually construct a cpointer with a raw pointer value? 
>> I 
>> suppose this would mean being able to construct a chez record in racket.
>> 
>> My use case is that I have a remote process talking to a racket process, it 
>> is 
>> sending a pointer to some shared memory and I want to access that shared 
>> memory. It’s an array of c structs with some integer data and each has a 
>> pointer to some raw bytes.
>> 
>> Any way to do it?
>> 
>> Thanks
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/CDC4A5DF-6BE1-4B96-BF3A-0B19F2EB
>> F0AC%40gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/4218EB80-31C5-4011-B217-5B1F87E76A5E%40gmail.com.


Re: [racket-users] Manually create cpointer value in racket?

2020-10-07 Thread Matthew Flatt
Probably you want to use `cast`. If you have an integer `addr` that
corresponds to an address, then

 (cast addr _uintptr _pointer)

casts it to a C pointer.

Matthew

At Wed, 7 Oct 2020 10:28:42 -0500, Nathaniel Griswold wrote:
> Related to a question I asked earlier, but this time at the racket side:
> 
> Is there any way to manually construct a cpointer with a raw pointer value? I 
> suppose this would mean being able to construct a chez record in racket.
> 
> My use case is that I have a remote process talking to a racket process, it 
> is 
> sending a pointer to some shared memory and I want to access that shared 
> memory. It’s an array of c structs with some integer data and each has a 
> pointer to some raw bytes.
> 
> Any way to do it?
> 
> Thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CDC4A5DF-6BE1-4B96-BF3A-0B19F2EB
> F0AC%40gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20201007150803.1b%40sirmail.smtps.cs.utah.edu.


[racket-users] Manually create cpointer value in racket?

2020-10-07 Thread Nathaniel Griswold
Related to a question I asked earlier, but this time at the racket side:

Is there any way to manually construct a cpointer with a raw pointer value? I 
suppose this would mean being able to construct a chez record in racket.

My use case is that I have a remote process talking to a racket process, it is 
sending a pointer to some shared memory and I want to access that shared 
memory. It’s an array of c structs with some integer data and each has a 
pointer to some raw bytes.

Any way to do it?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CDC4A5DF-6BE1-4B96-BF3A-0B19F2EBF0AC%40gmail.com.