3 ms·
The OP isn't trying to criticize Python... he was just trying to give an example of what it means for everything (in LISP) to be an expression. He didn't say t
by jbotz 7y ago
The OP isn't trying to criticize Python... he was just trying to give an example of what it means for everything (in LISP) to be an expression. He didn't say that Python doesn't have an "if expression"... just that you can't use the if statement in an expression context.
- crimsonalucard 7y agoOP literally says this: In Python, an if conditional is a statement, and can only be used in certain positions. This is categorically wrong. In python the if conditional exists in statement form and expression form. The if-expression also basically exists in every other imperative language out there, usually in this form: x + (is_true() ? 1 : 2) I know he's not trying to criticize python. Just want to correct his mistake and emphasize that python has intrinsic design features that can make it very very functional.
- earenndil 7y agoYep. Also most c-derived languages have 'progn' as the comma operator. Expression-...ism? is not really a problem.
- hencq 7y agoI think you just misinterpreted the point he's making. Yes, Python has an expression form for if, but it's a separate form. You can definitely write functional Python, but the point he makes is that Python differentiates between expressions and statements.
- crimsonalucard 7y agoNo I made no mistake. I get his point. Look at my reference. I literally posted the statement that is categorically wrong. He literally says that in python the if-conditional is a statement. This is False. I also offer some proof as to why python is a bad choice for his examples because python is actually a highly functional language. It's like trying to use haskell to prove racket is more expressive. It's a bad choice. Sometimes I don't understand people. I literally posted just factual errors, no opinions on his article and then people misinterpret everything I said as opinion and proceed to tell me I misinterpreted things, then vote me down. Seriously.