Last active
August 29, 2015 14:04
-
-
Save nubbel/ffeec3b7146689d4fcde 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
| infix operator < { associativity left } | |
| func <<T : Comparable>(lhs: T, rhs: T) -> ((T, T) -> Bool, () -> T) -> Bool { | |
| return { (op: (T, T) -> Bool, value: () -> T) in | |
| (lhs < rhs) && op(rhs, value()) | |
| } | |
| } | |
| func <<T: Comparable>(lhs: ((T, T) -> Bool, () -> T) -> Bool, rhs: @autoclosure () -> T) -> Bool { | |
| return lhs({$0 < $1}, rhs) | |
| } | |
| var x: Int = 5 | |
| if 1 < x < 10 { | |
| true | |
| } | |
| else { | |
| false | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment