Personally...
If you have "... do stuff ..." or ": data", I would just check the amount of data or add a similar check. If count = 0, return an empty list '()', and not a generic null '(: :)', which you will return in your function currently.
Generic null is the problem here and what you want to fix.
Example below ...
// example returning generic null q){if[x~0;:(::)];([]2?10)}each 1 0 3 +(,`x)!,4 4 :: +(,`x)!,7 9 q)raze {if[x~0;:(::)];([]2?10)}each 1 0 3 (,`x)!,6 (,`x)!,2 :: (,`x)!,9 (,`x)!,2 // put a check in against 'data' to return an empty list if count=0 or similar q){if[x~0;:()];([]2?10)}each 1 0 3 +(,`x)!,3 2 () +(,`x)!,1 8 // your raze works now q)raze {if[x~0;:()];([]2?10)}each 1 0 3 x - 3 1 7 2
source share