Hi! On Fri 09 Apr 2010 21:46, l...@gnu.org (Ludovic Courtès) writes:
> Andy Wingo <wi...@pobox.com> 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/