[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: modifying pointers
From: |
Andy Wingo |
Subject: |
Re: modifying pointers |
Date: |
Fri, 09 Apr 2010 22:15:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) |
Hi!
On Fri 09 Apr 2010 21:46, address@hidden (Ludovic Courtès) writes:
> Andy Wingo <address@hidden> writes:
>
>> I'm just wondering if it is valid to create a ((void*) 777) pointer.
>> Under what condition is that useful?
>
[...]
> It opens the door to all sorts of crazy things. :-)
Cool :)
FWIW, let's kick that door off its hinges :-)))
>> If that is useful, OK; but under what condition is it useful to mutate
>> the pointer in a foreign pointer object? Why not create a new foreign
>> pointer object?
>
> There’s currently no procedure to create a foreign object from a
> bignum.
Perhaps we should define one then. It would be more expressive. Also it
avoids all kinds of shared-state problems.
> (Besides, ‘foreign-set!’ exists and has always been defined for all
> types of foreign pointer objects.)
Sure, but this might be an accident. In every case except `void',
foreign-set! modifies the pointed-to memory. Perhaps we need a
foreign-pointer accessor instead, which would work on pointers to values
as well. And a constructor of course.
Andy
--
http://wingolog.org/