Call by binding [was Re: [Tutor] beginning to code]

Marko Rauhamaa marko at pacujo.net
Mon Sep 25 15:35:12 EDT 2017


Chris Angelico <rosuav at gmail.com>:

> On Tue, Sep 26, 2017 at 12:26 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Sorry, that was my bad in the terminology. But where do you get that
> all Python expressions evaluate to pointers?

What do they evaluate to if not pointers? Anton's "identities" would
work, too. "Address" would do, as well. I have previously proposed the
term "leash." Call it "link" or "handle" or "arrow" if you want to.

The term used isn't important. What's important is to understand that
each expression and subexpression produces and operates on pointers.

>> It also uses circular definitions when talking about dicts and lists:
>>
>>    That object is then asked to assign the assigned object to the given
>>    attribute
>>
>>    the sequence is asked to assign the assigned object to its item with
>>    that index.
>
> Technically, that's correct. When you use a statement like:
>
> foo[bar] = quux
>
> what it does is ask the object *foo* to assign *quux* to the item
> represented by *bar*.

What is missing is the definition of that assignment in the specific
case of dicts and lists. The recursive definition must be well-founded.
It covers variables ("names") but leaves the two other fundamental cases
(dicts and lists) undefined.

(I'm actually guessing the definition is missing because the author
couldn't find good language for the cases. Apparently, "dict attribute
binding" and "list element binding" weren't attractive enough.)

> But you have yet to show how you can jump from "name binding" to
> "pointer" using anything from the Python documentation.

There's nothing to show. It's a simple matter of terminology.

"Binding" is a passable synonym for "pointer."


Marko



More information about the Python-list mailing list