Raul Miller asked for a plausible application of
"spread".  Here is one:  I have a long list of 
sorted names and I want to display the list "n-up".
For my own eyes it is much easier to scan up and
down rather than back and forth horizontally.  e.g.

   3 spdj ' ',.~ >nl_z_ 3
Note           expand         toHOST         
apply          fetch          toJ            
assert         jcwdpath       tolower        
boxopen        jhostpath      toupper        
boxxopen       jpath          type           
break          jsystemdefs    ucp            
bx             list           ucpcount       
clear          load           utf8           
coclass        loadd          wcsize         
cocreate       loadp          wd             
cocurrent      nameclass      wdbox          
codestroy      namelist       wdcenter       
coerase        names          wdclipread     
cofullname     nc             wdclipwrite    
coinsert       nl             wde            
coname         open           wdfit          
conames        pick           wdforms        
conew          require        wdget          
conl           script         wdhandler      
copath         scriptd        wdinfo         
coreset        scripts        wdishandle     
cutopen        setbreak       wdisparent     
datatype       sign           wdmove         
do             smoutput       wdpclose       
drop           sort           wdqshow        
edit           split          wdquery        
empty          startupconsole wdreset        
erase          take           wdselect       
exit           toCRLF         wdstatus       



----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Sunday, February 18, 2007 2:02 pm
Subject: Re: [Jprogramming] Style and Literacy in APL

> The version in the appended msg is wrong.
> Correction version as follows:
> 
> spd=: 4 : 0
> ((1{f),*/0 2{f) $, 1 0 2|:(f=.x,c%x,1) $, (c=.d+(x|x-0{(d=. 
> $y)),0){. y
> )
> 
> spdj=: [: ,./ -@>.@(%~#) ]\ ]
> 
>   3 (spd -: spdj) i.7 4
> 1
>   3 (spd -: spdj) i.23 4
> 1
> 
> The original APL version can be improved even
> in APL.  For example,  x|x-y is equivalent to
> x|-y .
> 
> 
> 
> ----- Original Message -----
> From: Roger Hui <[EMAIL PROTECTED]>
> Date: Sunday, February 18, 2007 1:12 pm
> Subject: Re: [Jprogramming] Style and Literacy in APL
> 
> spdj=: [: ,./ [EMAIL PROTECTED] ]\ ]
> 
>  3 spdj i.7 4
> 0 1  2  3 12 13 14 15 24 25 26 27
> 4 5  6  7 16 17 18 19  0  0  0  0
> 8 9 10 11 20 21 22 23  0  0  0  0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to