using System; namespace Utils { class COrderedHandler { public delegate TInvoke(_ : object, _ : EventArgs) : void; public Invoke(_xSource : object, _xArgs : EventArgs, _xNextHandler : TInvoke) : void { } } class COverloadableEvent['Handler] where 'Handler : COrderedHandler { private mutable _lHandlers : list['Handler] = []; public Invoke() : void { def MakeFuncCall( lHandlers = _lHandlers ) : object * EventArgs -> void { | xHandler :: lTail => { def f(a : object, b : EventArgs) { xHandler.Invoke( a, b, MakeFuncCall(lTail) ); } f } | [] => null } _ = MakeFuncCall (); } } module Test { public Main() : void { } } } /* BEGIN-OUTPUT END-OUTPUT */