In the Julia manual metaprogramming section, we see the following example for how to use interpolation in an expression:
julia> ex = :(a in $:((1,2,3)) )
:($(Expr(:in, :a, :((1,2,3)))))
Given that I can create another expression
julia> ex1 = :(a in (1,2,3) )
:($(Expr(:in, :a, :((1,2,3)))))
julia> ex == ex1
true
Is there any reason for the extra $:(...)
in the manual's example? Or is it just to indicate possibilities of this construction -- that $
and :(...)
are "inverses"?