Created
June 4, 2014 21:19
-
-
Save kourge/38c1d3a07a5dee9407c0 to your computer and use it in GitHub Desktop.
Fun with double arrow / hash rocket in Swift
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
operator infix => { associativity left } | |
func => <K : Hashable, V>(key: K, value: V) -> (K, V) { | |
return (key, value) | |
} | |
let pairs: (String, Int)[] = [ | |
"e" => 10, | |
"t" => 7, | |
"i" => 2 | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Swift seems to have no problem with it if you leave out associativity but every mention of custom infix operators in the docs declares associativity out of convention.