A question on modification of a list via a function invocation

Chris Angelico rosuav at gmail.com
Wed Sep 6 05:20:10 EDT 2017


On Wed, Sep 6, 2017 at 7:01 PM, Gregory Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> Chris Angelico wrote:
>>
>> You can't do this with Python, since pointer arithmetic fundamentally
>> doesn't exist.
>
>
> Pointer arithmetic doesn't exist in Pascal either, yet
> Pascal most definitely has pointers as a distinct data
> type.
>
> Insisting that only pointer arithmetic counts as
> "manipulating" pointers seems a strange way of defining
> the word.

Understood. I'm withdrawing the assertion that pointer arithmetic is
essential, weakening the demand to the ability to:

1) Take the address of an object (yielding a pointer)
2) Move the pointer around as its own thing, eg pass it as a function parameter
3) Dereference the pointer, to read or write the original object

But you have to be able to prove that #2 is actually looking at the
pointer as its own entity. This has to be distinct from passing around
the object itself in some way.

ChrisA



More information about the Python-list mailing list