title: q - apply function on table rowwise
body: <p>Given a table and a function</p>
  
  <pre><code>t:([] c1:1 2 3; c2:`a`b`c; c3:13:00 13:01 13:02)
  f:{[int;sym;date] 
      symf:{$[x=`a;1;x=`b;2;3]};
      datef:{$[x=13:00;1;x=13:01;2;3]};
      r:int + symf[sym] + datef[date];
      r
   };
  </code></pre>
  
  <p>I noticed that when applying the function <code>f</code> onto columns of <code>t</code>, then the entire columns are passed into <code>f</code> and if they can be operated on atomically then the output will be of the same length as the inputs and a new column is produced. However in our example this wont work:</p>
  
  <pre><code>update newcol:f[c1;c2;c3] from t / 'type error
  </code></pre>
  
  <p>because the inner functions <code>symf</code> and <code>datef</code> cannot be applied to the entire column <code>c2</code>, <code>c3</code>, respectively. </p>
  
  <p>If I <strong>dont</strong> want to change the function f at all, how can I apply it row by row and collect the values into a new column in <code>t</code>.</p>
  
  <p>What's the most <code>q</code> style way to do this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>If not changing <code>f</code> is really inconvenient one could workaround like so</p>
  
  <pre><code>f:{[arglist]
      int:arglist 0;
      sym:arglist 1;
      date:arglist 2; 
      symf:{$[x=`a;1;x=`b;2;3]};
      datef:{$[x=13:00;1;x=13:01;2;3]};
      r:int + symf[sym] + datef[date];
      r
   };
  
  f each (t`c1),'(t`c2),'(t`c3)
  </code></pre>
  
  <p>Still I would be interested how to get the same result when working with the original version of <code>f</code></p>
  
  <p>Thanks!</p>