// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class C { private int v; public C(int v) { this.v = v; } public override string ToString() { return v.ToString(); } } public delegate T Create(); public class BigG { private Create p; public BigG(Create p) { this.p = p; } public T GiveMe() { return p(); } } public class Program { public static void Main(string[] args) { BigG g = new BigG(() => new C(42)); C o = g.GiveMe(); Console.WriteLine(o); } } }