Is there a Julia function similar to the R function `with`?

This has been discussed before, for example here and here.

My impulse is to accomplish something like this with function keywords, e.g.

julia> t = (a=2, b=3)
(a = 2, b = 3)

julia> foo(;a, b) = a + b
foo (generic function with 1 method)

julia> foo(;t...)
5
2 Likes