1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
delegate void FooFunc (); class Foo { public int bar () { return 23; } } void run (FooFunc func) { func (); } void main () { var foo = new Foo (); run (() => { with (foo) { assert (bar () == 23); } }); }