Closed xiaodaigh closed 1 year ago
The expression [1:4] is an array containing a single element, which is a range. Perhaps you meant the following?
julia> Pkg.status()
Status `~/.julia/environments/v1.6/Project.toml`
[7eb4fadd] Match v2.0.0
julia> using Match
julia> @ismatch 1:4 [a, b..., c]
true
julia> a
1
julia> b
2:3
julia> c
4
I was hoping
a = 1
,b = [2, 3]
andc = 4
. Python has an unpacking feature similar to this.