// 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 Program { /* public static Func Compose(Func f1, Func f2) { return x => f2(f1(x)); } */ public static Func Compose(Func f1, Func f2) { return x => f2(f1(x)); } public static void Main(string[] args) { Func mul2 = x => 2 * x; Func mul3 = x => 3 * x; Func mul6 = Compose(mul2, mul3); Console.WriteLine(mul6(7)); } } }