Hello.
How can I make the following structure literal shorter:
let s = S {
abc: 1,
def: 2,
a1: FUNCA(some.a1),
a2: FUNCA(some.a2),
a3: FUNCA(some.a3),
a4: FUNCA(some.a4),
a5: FUNCA(some.a5),
a6: FUNCA(some.a6),
a7: FUNCA(some.a7),
b1: FUNCB(some.b1),
b2: FUNCB(some.b2),
b3: FUNCB(some.b3),
b4: FUNCB(some.b4),
b5: FUNCB(some.b5),
b6: FUNCB(some.b6),
b7: FUNCB(some.b7),
};
If it were possible, I would create a macros that would expand to a list of "key:value," pairs.
However, as HJVT answered in my previous question, it doesn't work the way I tried it.
Is there any other way to make this structure literal shorter and avoid code duplication?