4 ms·
Python one-liners are already possible using ; python -c 'import sys; a = int(sys.stdin.readline())) ; print(range(a))' EDIT: Not that I'm saying piep is
by icebraining 15y ago
Python one-liners are already possible using ;
python -c 'import sys; a = int(sys.stdin.readline())) ; print(range(a))'
EDIT: Not that I'm saying piep is useless; far from it, it seems very interesting. I'm saying that optional {}s wouldn't solve the problem that piep is trying to solve.
- berntb 15y agoYes, but my point was: How do you add an if to that Python code... or anything else dependent on Python indentation? Another example: map {} is better than having to learn weird single instruction variants like list comprehensions. And so on. In this case, it is easy to have a shell alias that loads a module and executes its parameter in any other language. Then you have any piep functionality not already built in. Ergo, no need for extra things to learn, in those languages.
- michaelmior 15y agoYou add an if using the ternary style syntax. i.e. "if foo then bar else baz". I think that's sufficient for what piep is trying to do. I can't imagine trying to do anything else with indentation that couldn't be accomplished with list comprehensions.
- berntb 15y agoSigh, do people really don't want to see that full support for one liners (not to mention anon funs of > 1 instruction) is a feature?! :-(
- michaelmior 15y agopiep seems to be designed for quick processing on the command line. If you want to do something especially complicated, you can (and probably should) write a separate script for it.