Re: Experiences/guidance on teaching Python as a first programming language

Dave Angel davea at davea.name
Thu Dec 19 07:06:44 EST 2013


On Thu, 19 Dec 2013 19:41:00 +1300, Gregory Ewing 
<greg.ewing at canterbury.ac.nz> wrote:
> But it's not above inferring a dereferencing
> operation when you call a function via a
> pointer. If f is a pointer to a function,
> then


>     f(a)


> is equivalent to


>     (*f)(a)


> If the compiler can do that for function calls,
> there's no reason it couldn't do it for member
> access as well.

Quite right.  And I recall being confounded by the function pointer 
syntax; it never fit in my mental model of how the rest of C worked.

Anyway I was not intending to defend C choices,  merely to point out 
an advantage this choice gave me.  On a language without garbage 
collection,  the indirection was very important to keep in mind.

-- 
DaveA




More information about the Python-list mailing list