Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.
sjdevnull at yahoo.com
sjdevnull at yahoo.com
Sat Feb 20 02:17:10 EST 2010
On Feb 20, 1:30 am, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message <op.u8at0suda8ncjz at gnudebst>, Rhodri James wrote:
>
> > In classic Pascal, a procedure was distinct from a function in that it had
> > no return value. The concept doesn't really apply in Python; there are no
> > procedures in that sense, since if a function terminates without supplying
> > an explicit return value it returns None.
>
> If Python doesn’t distinguish between procedures and functions, why should
> it distinguish between statements and expressions?
Because the latter are different in Python (and in Ruby, and in most
modern languages), while the former aren't distinguished in Python or
Ruby or most modern languages? Primarily functional languages are the
main exception, but other than them it's pretty uncommon to find any
modern language that does distinguish procedures and functions, or one
that doesn't distinguished statements and expressions.
You can certainly find exceptions, but distinguishing statements and
expressions is absolutely commonplace in modern languages, and
distinguishing functions and procedures is in the minority.
More information about the Python-list
mailing list