User loginNavigation |
Is there an existing name for my higher-order function?I have groups of functions that get called with the exact same arguments: a = func_a(arg1, arg2, arg3, arg4, arg5); b = func_b(arg1, arg2, arg3, arg4, arg5); c = func_c(arg1, arg2, arg3, arg4, arg5); To reduce duplication, I have a helper function that accepts any number of arguments and returns a second helper function. When called, this second function applies the arguments it was constructed with to other functions: bar = foo(arg1, arg2, arg3, arg4, arg5); a = bar(func_a); b = bar(func_b); c = bar(func_c); My question is, what's the best name for "foo" in this second example? I've looked for higher-order functions in various languages but I'm having trouble finding examples of my specific usage--there are similar functions but nothing exactly the same. I'm hoping to find a canonical name for what I'm doing (if one exists). Like partial, foo() fixes the given arguments but it doesn't bind them to a specific function. The best name I can come up with is enclose() or callwith(). If anyone know of an already-existing name for this, I'd like to hear what it is. By shawnbrown at 2016-08-02 21:59 | LtU Forum | previous forum topic | next forum topic | other blogs | 7323 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 15 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago