Skip to content

Instantly share code, notes, and snippets.

@dnorton
Last active February 13, 2017 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnorton/a5dd7ee2bb8233ef8d61f61005c35b6d to your computer and use it in GitHub Desktop.
Save dnorton/a5dd7ee2bb8233ef8d61f61005c35b6d to your computer and use it in GitHub Desktop.
example of tuples in groovy
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