https://learninghub.kx.com/forums/topic/dictionaries-as-functions
I have 2 functions defined in the test namespace:
.test.ex.t1:{[data] xxx; xxx;};
.test.ex.t2:{[data] xxx; xxx;};
Then, I want call these functions as below:
.test.ex .' ((`t1;data);(`t2;data))
but I run into a length error - what's the correct syntax?
/: each-right is what you want https://code.kx.com/q/ref/maps/#each-left-and-each-right
q).test.ex.t1:{[data] data};
q).test.ex.t2:{[data] data};
q).test.ex ./:((t1;1);(
t2;1))
1 1
If you look at your dictionary you can see that your key is a symbol atom, so you have to index by a symbol. Once you have done that, you can pass the value as parameter. This syntax should work
// Your dictionary
q).test.ex
| ::
t1| {[x] x}
t2| {[x] x}
q).test.ex[`t1`t2]@'3 4
3 4