Created
June 23, 2012 21:51
-
-
Save stepancheg/2980181 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
define subtuple; | |
[n1] | |
overload subtuple(t, static n1, ..ns) { | |
return Tuple(..unpack(subtuple(t, static n1)), ..unpack(subtuple(t, ..ns))); | |
} | |
[n] | |
overload subtuple(t, static n) = [staticIndex(t, static n)]; | |
main() { | |
var t = [17, "a", 33, "d"]; | |
println(subtuple(t, static 3, static 2)); | |
println([t.3, t.2]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment