A Julia package providing the macros @↓
and @↑
.
ArrowMacros is a registered package compatible with Julia v1.0 and above. From the Julia REPL,
]add ArrowMacros
@↓
and @↑
provide ExtractMacro.jl-like features with UnPack.jl-like syntax and speed. For example,
using ArrowMacros
mutable struct A; a; b; c; end
mutable struct B; d; e; end
s = A(1, [2, 3], B(4, [5, 6]))
@↓ a, b ← b .- a = s
# (a, b) == (1, [1, 2])
a += 1
@↑ s = a, b ← (@. 2b - 1)
# (s.a, s.b) == (2, [1, 3])
Read the documentation for a complete overview of this package.