Last active
December 14, 2015 11:59
-
-
Save supki/5082879 to your computer and use it in GitHub Desktop.
Always easy to read.
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
| def f(a, b, c): | |
| return a ** (b ** c) | |
| def g(a, b): | |
| return (b, a) | |
| >>> f(2, *g(2,3)) | |
| 512 | |
| >>> f(2, *g(3,2)) | |
| 256 |
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
| def f a, b, c | |
| a ** (b ** c) | |
| end | |
| def g *xs | |
| xs.reverse | |
| end | |
| irb(main):002:0> f(2, *g(2, 3)) | |
| => 512 | |
| irb(main):003:0> f(2, *g(3, 2)) | |
| => 256 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wat