q){(update b:99 from x){[x;y]update b:y from x}0} flip a
b!2 3# til 4
{(update b:99 from x){[x;y]update b:y from x}0}
'type
@
+a
b!(0 1 2;99 99 99)
{[x;y]update b:y from x}[0]
it appears that q doesn’t see (update b:99 from x) as
an x-value and, instead, takes 0 as the x-value.
any tips for better style?
ta, jack.
how about??
? ? ? ? ? { {[x;y]update b:y from x}[update b:99 from x;0]} flip a
b!2 3# til 4
Junan
yes, infix isn’t available in general for user-created functions, only
for things in the .q namespace and for invocations involving adverbs.
the original code applies 0 to the dyadic inner function, returning a
projection, which is then “applied” to the table resulting from the
outer update, which results in the type error.