Skip to content

Instantly share code, notes, and snippets.

@keichi
Last active December 20, 2015 11:09
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 keichi/6120937 to your computer and use it in GitHub Desktop.
Save keichi/6120937 to your computer and use it in GitHub Desktop.
var tuple = Tuple.Crate("hoge", 1);
// こうじゃなくて
var a = tuple.Item1;
var b = tuple.Item2;
var f = new Func<Tuple<string, int>, bool>(t => t.Item1.Length == t.Item2);
// こんな感じ
var (a, b) = tuple;
var f = new Func<Tuple<string, int>, bool>((s, x) => s.Length == x);
// これもできたらいいなあ
var (a, (b, c)) = (1, ("hello", false));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment