> From: Zsbán Ambrus
> 
> You have to box the data again before you reassemble it.  Some other
> messages show tricky ways to do this automatically with the under conj
> (or even level, yuck), but it's probably easier to do it by hand.
...
> 
> and then you can apply this verb to the whole boxed list:
> 
> < b_jonas> ):: ([: < mm # >)"0 t1
> < jeval> b_jonas: +--------+--------+--------+--------+
> < jeval> b_jonas: |20090904|20090903|20090902|20090901|
> < jeval> b_jonas: +--------+--------+--------+--------+

I think this is a useful approach from a didactic point of view - it is 
essentially a model of the approach using the under conjunction. However from a 
practical point of view it doesn't really make use of J's strengths (because it 
works with small bits of data at a time). Bill's approach (<"1 mm #"1 > t1) 
does the same thing but on bigger bits of data at a time resulting in faster, 
leaner performance. 

Comparing this approach to that using the under conjunction highlights the 
performance improvements of the code optimizations to &.>  :

   30 ts 'mm&# &.>tst'          NB. Using under
0.0312943447319 7334976
   30 ts '<"1 mm#"1>tst'        NB. Working on big chunks
0.0391365798689 9432512
   30 ts '([: < mm # >)"0 tst'  NB. Working on little chunks
0.188038321345 15078848

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to