Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

Lie Ryan lie.1296 at gmail.com
Sat Feb 20 02:24:13 EST 2010


On 02/20/10 18:17, sjdevnull at yahoo.com wrote:
> 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.

But it all boils down to "Although practicality beats purity."



More information about the Python-list mailing list