I want to define a sweet macro that converts
{ a, b }
in
{ o.a, o.b }
My current attempt
macro (
case infix { { $prop:ident (,) ... } | _ $o } => {
return
}
}
However, it gives me
SyntaxError: [patterns] Ellipses level does not match in the template
I suspect that I do not understand how it works ..., and it may be necessary to somehow sort through the values $propand build syntax objects for each and somehow connect them, but I do not understand how to do this.
user663031
source
share