I would like to update a table by reference without getting an assign error in kdb i.e.
q)tab:1!(flip`a`b`c!(til 10;10?50;10?100));
q)k:2#key[tab];
q)(`tab[k;`b`c])*:2;
parse error
assign
or
q)[.:][`tab][k;`b`c]*:2;
parse error
assign
(obviously one cannot assign a value to a derived variable)
Notably the following work:
q)(tab[k;`b`c])*:2;
I've made the assumption here that there are better methods to achieve this than using eval
or value[`tab] I was hoping I could get a second opinion to that end.
How might one implement the set by reference as shown in the example above with a "symbolic" reference to a table?
Thanks again, best regards.