Skip to content

Instantly share code, notes, and snippets.

@kg
Forked from TryJSIL/Closures.cs
Created April 28, 2012 09:39
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 kg/2517499 to your computer and use it in GitHub Desktop.
Save kg/2517499 to your computer and use it in GitHub Desktop.
Closures v2
using System;
public static class Program {
public static void Main (string[] args) {
int x = 1;
string y = "y";
Func<string> a = () => {
return String.Format("x={0}, y={1}", x, y);
};
Console.WriteLine("a()={0}", a());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment