Hi, On Fri 09 Apr 2010 18:30, l...@gnu.org (Ludovic Courtès) writes:
> Andy Wingo <wi...@pobox.com> writes: > >> You added a change to foreign-set! for %null-pointer. Would it not make >> sense instead to make foreign pointers of type "void" unsettable? > > Not necessarily. See the test that was added: > > (pass-if "foreign-set! other-null-pointer" > (let ((f (bytevector->foreign (make-bytevector 2)))) > (and (not (= 0 (foreign-ref f))) > (begin > (foreign-set! f 0) > (= 0 (foreign-ref f))) > (begin > ;; Here changing the pointer value of F is perfectly valid. > (foreign-set! f 777) > (= 777 (foreign-ref f)))))) > > Here a ((void *) 777) pointer is created. I'm just wondering if it is valid to create a ((void*) 777) pointer. Under what condition is that useful? 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? Andy -- http://wingolog.org/