A functional dictionary update is also possible with the standard change / install syntax (using ":") as follows:
q)x:1 2 3
q)d:x!x
q)d
1| 1
2| 2
3| 3
q)f:{d[x]:y}
q)f[2;7]
q)d
1| 1
2| 7
3| 3
This also works for vectors provided that they have the same length:
q)f[1 2;5 6]
q)d
1| 5
2| 6
3| 3
source
share