This is a very easily testable theory.
This is a very easily testable theory.
That's almost identical to python, but how do you make it exactly identical? Nobody knows.
http://www.python.org/dev/peps/pep-3103/
Tested. Found false.
Now how about Scheme? I recently tested that myself by using a case expression, a syntax I rarely use. I didn't have to look in R5RS. I just put the parens where they would naturally go for the most obvious syntax tree, and it worked.
For someone steeped in Algol-like languages, Python will be easy to get started with. Scheme/Lisp takes longer to get started, but once you get it, you don't have to keep going back to the documentation. It just makes sense.
case beercount
0 1 "inanity"
2 3 4 "good sense"
else "genius"
Drink all you want. The pseudocode above still translates into Scheme in a straightforward way. The Python community still can't agree how to translate it.Your example falls short because case statements aren't such an obvious method of solving the problem as you think. They are nothing more than an artifact of the machine that C pushes up to you.
Concise? I've got some perl code for you.
if beercount is 0 or 1 return "inanity"
if beercount is in 2,3,4 return "good sense"
return "genius"
I wouldn't advocate that. I think my first version is more concise in a clear way, not in a line-noise way.