[Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308) (original) (raw)
Alex Martelli aleaxit at gmail.com
Fri Aug 7 16:55:44 CEST 2009
- Previous message: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)
- Next message: [Python-Dev] (try-except) conditional expression similar =?iso-8859-1?q?to=09?=(if-else) conditional (PEP 308)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2009/8/7 Kristján Valur Jónsson <kristjan at ccpgames.com>:
Unless I am very much mistaken, this is the approach Ruby takes. Everything is an expression. For example, the value of a block is the value of The last expression in the block.
I've never understood the need to have a distinction betwen statements and expressions, not when expressions can have side effects. It's like that differentce between procedures and functions in pascal that only serves to confuse
If you're interested in understanding it better, research Query-Command Separation (QCS), e.g. starting at http://en.wikipedia.org/wiki/Command-query_separation and links therefrom.
Alex
- Previous message: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)
- Next message: [Python-Dev] (try-except) conditional expression similar =?iso-8859-1?q?to=09?=(if-else) conditional (PEP 308)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]