how much does Python model my Compsci course?
Grant Edwards
grante at visi.com
Thu May 31 13:27:06 EDT 2001
In article <Pine.GSO.4.21.0105311240090.10131-100000 at y.glue.umd.edu>, Roy Katz wrote:
>I'm wondering what amount of this material is applicable to Python
Probably most of it.
>(backgrounder: I've been using Python since the end of '96 in 10th
>grade). Have any of you heard of a 'dope vector'?
Not that I can remember, but it's been 15 years since I took
the course that probably would have covered that material.
>What is Python's internal equivalent? How about a 'central
>environment table' (as opposed to 'activation records')?
I don't know what a "central environment table" is either.
>Last year I asked here wether Python uses pass-by-reference;
>Then I learned that there are four or five major types of param
>passing (the others being pass-by-{name,result,value,value-result}).
>But Python looks as if it has invented a new form to (perhaps a
>variation on pass-by-ref) param passing, based on whether or
>not the object passed in is mutable (from what I
>understand...?)
Python uses pass by value.
However, all values are references.
When you do:
foo(x)
What is passed to foo is the value of x.
The value of x is a reference to an object.
>Which leads me to wonder if what I'm being taught in class is dated.
A little of it might be, but it's still good to know. Those
who forget history are doomed to repeat it.
>Dear G-d, we were using Pascal syntax for learning arrays,
>functions and param passing (nevermind that our projects were
>in perl and java).
I don't think there's anything terribly "wrong" with Pascal
syntax.
>I can't /read/ Pascal anymore. It's too much to type. It's like
>this post; so much of the program is keywords that finding the
>programmer's intention is like finding a needle in a hay silo.
>But enough about Pascal. I suspect that Python has left these
>concepts (dope vector, pass-by-*) in the dust, and just went
>its own path.
--
Grant Edwards grante Yow! As a FAD follower,
at my BEVERAGE choices are
visi.com rich and fulfilling!
More information about the Python-list
mailing list