Re: Pointer variables possible?
Steven Miale (firstname.lastname@example.org)
Thu, 7 Apr 1994 12:53:05 -0500
In article <CnsyqC.J84@murdoch.acc.virginia.edu>,
Steven D. Majewski <email@example.com.Virginia.EDU> wrote:
>In article <Cnsn6q.1pL@spk.hp.com>, Bill Baker <firstname.lastname@example.org> wrote:
>>I have come upon a situation that I feel would benefit from storing pointers
>>to several items in a list type that would enable insertions at these points.
>>I don't know much about the internal workings of python and whether this
>>would be possible but with C it would only require the use of an address
>>pointer. I have looked through the python references I have but being new
>>to python I don't know if this is possible.
>Python does not have pointers, but references to mutable objects
>ARE references to the OBJECT, and not the VALUE.
Maybe what we need are Scheme-style "boxes." They provide a form
of "call-by-reference", like so:
> (set! x (box 3))
> (define make-it-four
(set-box! foo 4)))
> (make-it-four x)
> (unbox x)
Steven Miale - email@example.com | Don't blame me -
Indiana University, Bloomington, IN | I voted Libertarian.