14 Jul 2006 03:38
Re: Mutable Pointers
Stuart Sierra <mail <at> stuartsierra.com>
2006-07-14 01:38:05 GMT
2006-07-14 01:38:05 GMT
Stephen Compall <s11 <at> member.fsf.org> writes: > Stuart Sierra wrote: >> I'm working on a CFFI interface to the Perl API (I thought >> it would be fun - ha!) and I need to be able to do C-style >> pointer arithmetic. That is, I have a foreign pointer >> declared with DEFCVAR and I need to alter the address stored >> there. I couldn't see a way to do this with CFFI, so I > > You've got one half of the answer already -- `make-pointer'. Now see > `pointer-address' > (http://common-lisp.net/project/cffi/manual/html_node/pointer_002daddress.html). But POINTER-ADDRESS is not setf-able, is it? I want to do this: (defcvar "stack_pointer" :pointer) (incf (pointer-address *stack-pointer*)) where "stack_pointer" is a global variable in an external library. But... The function (SETF POINTER-ADDRESS) is undefined. [Condition of type UNDEFINED-FUNCTION] -Stuart
RSS Feed