What other languages use the same data model as Python?

Albert van der Horst albert at spenarnc.xs4all.nl
Fri May 20 16:56:40 EDT 2011


In article <mailman.1286.1304760534.9059.python-list at python.org>,
Chris Angelico  <rosuav at gmail.com> wrote:
>On Sat, May 7, 2011 at 7:21 PM, Gregory Ewing
><greg.ewing at canterbury.ac.nz> wrote:
>> Hans Georg Schaathun wrote:
>>
>>> You cannot reference nor manipulate a reference in python, and that IMHO
>>> makes them more abstract.
>>
>> You can manipulate them just fine by moving them
>> from one place to another:
>
>I think "manipulate" here means things like pointer arithmetic, which
>are perfectly normal and common in C and assembly, but not in
>languages where they're references.

Adding an integer to a reference to an array element could have been
perfectly well-defined in Algol:
        ref real operator+(ref real, int)
That is called overloading of the plus operator not "pointer arithmetic".
It is a misconception that these manipulation are dirty or ill-defined
or unsafe.

A similar extension would be possible in Python.
Allusion to assembler where one adds a number to a register
and can't tell whether the register contains an address or data
are misleading.

[This is not to say that I think it is advisable].

>
>Chris Angelico

Groetjes Albert.

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert at spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst




More information about the Python-list mailing list