Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions 10_Expressions/Alathea_Expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ concat(quote(f), a = 1, b = quote(mean(a)))
#> f(a = 1, b = mean(a))
```

Possible solution:

```r
concat <- function(what, a, b){
as.call(list(what, substitute({a = a_arg}, list(a_arg = a))[[2]], substitute({b = b_arg}, list(b_arg = b))[[2]]))
}

concat(quote(f), a = 1, b = quote(mean(a)))
```


### Since list()s don’t belong in expressions, we could create a more convenient call constructor that automatically combines lists into the arguments. Implement make_call() so that the following code works.


Expand Down