English-like Python

J. Cliff Dyer jcd at sdf.lonestar.org
Tue Feb 3 09:54:16 EST 2009


On Thu, 2009-01-22 at 09:07 -0700, Joe Strout wrote:
> >>      Beep
> >>
> >> Doesn't get much more readable and syntax-free than that.
> > 
> > readable doesn't mean smallest amount of syntax possible sometimes
> syntax 
> > increases the readability of a text as you would see if we for
> example 
> > dropped all punctuation but you probably already knew that but
> perhaps 
> > you didnt draw the connection with programming language wink
> 
> Cute.  But I stand by my contention that "Beep" is about the most 
> readable way imaginable to express the "make a beep sound now please" 
> command, and any additional punctuation (parentheses, semicolons,
> etc.) 
> only get in the way.
> 

But what if your language allows functions to be used as first class
objects?  (Mine does :))  

x = Beep

Does that assign the name x to the Beep object or does it assign the
result of a Beep call to x?

There's no virtue in making ridiculously simple things even simpler if
it makes the interesting things impossible.

def tone_sequence(sound):
    sequence = DialTone.followed_by(sound)
    sequence()

for x in Beep, Buzz, Warble:
    tone_sequence(x)

Cheers,
Cliff





More information about the Python-list mailing list