Help with a little query

Ok, I think I get it. The following query works.

function myfun(A, B)
  mean(A) + mean(x -> x^2, B)
end
sdt = @from i in load("sisec_mus_2017_full.csv") begin
    @group @NT(score = i.score, track_id = i.track_id) by @NT(metric = i.metric, method = i.method) into g
    @select {g.key.metric, m = myfun(map(j -> j.score, g), map(j -> j.track_id, g) ) }
    @collect DataTable
end

This is pretty ugly though, but I see how the … syntax would clean it up a lot.