cancel
Showing results for 
Search instead for 
Did you mean: 

adverb projection/composition questions

erik_friis
New Contributor
Reading up on compositions and I see that one is created with the prefix form:

'[f;g]

Is there no infix form in q?

f'g signals an exception.

In k4 however both of these work--I would have expected them to be equivalent but they are not.

  f'g
{x+y}'[{x*y}]

 '[f;g]
{x+y}{x*y}

Furthermore, why does '['] have a type of 106 when ' is not a function and is expecting a function argument--why is it not a projection? '' is not a derived function as far as I can tell.

  @ ('['])
106h

Also please tell me why the ' gets replaced in the first expression.
  ('['])[+/]
+/'

  ('['[+/]])
+/''

Finally from an internal execution point of view (not result), is there any difference between these two expressions:

q)(+/'')((1 2;3 4);(5 6 7;8 9 10))
3  7
18 27

q)('[';'][+/])((1 2;3 4);(5 6 7;8 9 10))
3  7
18 27

Thanks for any insight.

0 REPLIES 0