Function closure constructions
- Dominant language
- Rust
- Stars
- 145
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
I think that passing around functions as data is a under-loved capability of R and I think part of it is how cumbersome it is to build a closure of a partially evaluated function, instead any functions-as-data approach requires building functions that return functions, encapsulating a few arguments.
Instead, it would be amazing if we could say "I'm not done specifying arguments yet"
```r
sum_one_plus <- sum(1).. # this says "I'm not done" and produces a partially evaluated function
sum_one_plus(2, 3, 4)
# [1] 10
```
_alternatively_
```r
sum_one_plus <- sum(1, ..) # perhaps too similar to ellipsis, although those might need to be named
sum_one_plus(2, 3, 4)
# [1] 10
```
Under the hood, this produces a new function call which starts to populate the function's internal environment with matched arguments and trims those matched arguments from the remaining function signature.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.