Last active
February 13, 2017 23:35
-
-
Save dnorton/a5dd7ee2bb8233ef8d61f61005c35b6d to your computer and use it in GitHub Desktop.
example of tuples in groovy
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 a = new Tuple2(null, "string") | |
def b = new Tuple2("string", null) | |
def c = new Tuple2(null, "string") | |
assert a == c | |
assert a != b | |
m = [:] | |
m[b] = "value" | |
println m[b] | |
m[a] = "both" | |
m[c] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment