While Match.jl provides such functionalities, in order to support users' redefinition of the way to destructure a struct, we disabled the default way to destructure normal structs like:
struct A
a_1
a_2
end
@match A(1, 2) begin
A(1, 2) => ...
end
I have an idea to solve this: register the structs to somewhere which marks all the structs that can be destructured.
struct A
a_1
a_2
end
@default_pattern A
@match A(1, 2) begin
A(1, 2) => ...
end
While Match.jl provides such functionalities, in order to support users' redefinition of the way to destructure a struct, we disabled the default way to destructure normal structs like:
I have an idea to solve this: register the structs to somewhere which marks all the structs that can be destructured.