On Thu, 2008-09-11 at 10:44 -0400, Mike Meyer wrote:
On Wed, 10 Sep 2008 15:39:49 -0700 Cliff Wells firstname.lastname@example.org wrote:
I strongly disagree. The artificial distinction between statements and expressions is the definition of *inconsistent*. Why do we have two versions of the "if" conditional? Why do we have "for" loops *and* list comprehensions? They express the same ideas, but the limitations in one required growing the language another direction.
Because they are each more readable for the cases they handle. I initially didn't like list comprehensions. In practice, they're not very hard to write, and even easier to read. Doing away with for loops because we have them would force you to construct - and then immediately throw away - lists in the case where the for loop was being executed for side effects.
There have been a number of similar proposals - I've even generated some. The general problem is that the results of embedding statements with important indentation into expressions is ugly. While I've seen a lot of words on this topic, I've seen very few concrete examples - and those seem to come as often from opponents to the idea as they do from you.
So, how about some concrete examples? Show us translations of the various if statements and for loops, so we have something concrete to use to judge readability?
Several examples have already been posted in this thread (which has probably gone on long enough).
Anyway, as was mentioned earlier, Logix very much resembles what I'm describing: