[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About the implementation of del in Python 3

On Fri, 7 Jul 2017 06:12 pm, Gregory Ewing wrote:

> Steve D'Aprano wrote:
>> That implies that it is impossible to implement Scheme:
>> - using a programming language where variables and objects may move during
>> their lifetime;
>> - or using a computing device without conventional memory, e.g. implementing
>> Scheme using hydraulics, DNA computing, clockwork, or emulated in the human
>> brain.
> Only if you interpret the word "address" very narrowly.

I don't know about that. Consider emulating a Python interpreter in your own
brain by executing in your own head some code that you read. Where in your
brain do the objects (the values) live? From everything we know about the
brain, they will be distributed across great big swaths of the brain, over
billions of neurons, and there is nowhere we could point to and say "this is
where our mental model of this object is".

The best we could say is that "if we damage such and such an area of the brain,
then the victim will be unable to perform the task of executing Python code in
his head, therefore we think that the objects are distributed in that area
rather than another area".

> By the way, even the low-level notion of "address" that C
> programs deal with is, on most modern hardware, a *virtual*
> address that goes through a level of translation before it
> identifies a physical set of transistors, and that mapping
> can change as stuff gets paged in and out. So it's already
> an abstract concept to some extent.

Indeed. But the Python virtual machine doesn't require objects to have an
address at all. Spacial thinking is so important for us primates that it is
hard for us puny humans to think of values without thinking of them existing in
some location, but there's no logical requirement for that to be the case.

?Cheer up,? they said, ?things could be worse.? So I cheered up, and sure
enough, things got worse.