How does Julia merge several exprs to one expr?

Not sure I completely understand what you’re trying to achieve, but this might be one way to do it:

julia> nn=[:(at=at), :(ct=ct)]
2-element Vector{Expr}:
 :(at = at)
 :(ct = ct)

julia> :($(nn...),)
:((at = at, ct = ct))

But may I ask what the broader context is? Why do you need to build such expressions?


PS: Welcome to the Julia discourse! Please post quoted code, instead of screenshots; this makes it easier for us to help you

4 Likes