Skip to content

Instantly share code, notes, and snippets.

@markrendle

markrendle/stacksie.cs

Last active Dec 29, 2015
Embed
What would you like to do?
class Bobbins
{
[CallStackLocal]
public static string Value = "Foo";
public static void Write()
{
Console.WriteLine(Value);
}
}
class Program
{
static void Main()
{
Bobbins.Write(); // Foo
Bar();
Bobbins.Write(); // Foo
}
static void Bar()
{
Bobbins.Value = "Bar";
Bobbins.Write(); // Bar
Etc();
}
static void Etc()
{
Bobbins.Write(); // Bar
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.