Created
August 2, 2017 15:46
-
-
Save cblp/3fc74cee6afb30b495f62f2256e1ea26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
true = lambda x, _: x | |
false = lambda _, y: y | |
lambda_bool = lambda b: [false, true][b] | |
force = lambda f: f() | |
enum = ( | |
lambda start, step, stop: | |
force( | |
lambda_bool(start <= stop) | |
(lambda: [start] + enum(start + step, step, stop), lambda: []) | |
) | |
) | |
print(enum(3, 2, 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment