Home › Forums › kdb+ › How to write local function which can be called from different levels › Re: How to write local function which can be called from different levels
-
You could pass it in to a projection
q)f:{[xF] g:{[xG] xG + 2}; h:{[g;xH] g[xH] + 3}[g]; g[xF] + h[xF]} q)f[40] 87
Or composition in this basic case
q)f:{[xF] g:{[xG] xG + 2}; h:+[3] g @; g[xF] + h[xF]} q)f[40] 87