Anonymous user
Partial function application: Difference between revisions
→Second approach: Simplified code a bit
(→{{header|C sharp}}: Added generalized version) |
(→Second approach: Simplified code a bit) |
||
Line 2,195:
' The function is generic solely to ease use for callers. In this case generics aren't providing any type-safety.
Function PartialApplyDynamic(Of TDelegate, TResult)(f As TDelegate, ParamArray args As Object()) As Func(Of Object(), TResult)
Dim del = CType(
Return Function(rest) CType(del.DynamicInvoke(ArrayConcat(args, rest).Cast(Of Object).ToArray()), TResult)
End Function
|