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
----- Original Message ----- From: "Miller, Raul D" <[EMAIL PROTECTED]> Date: Sunday, February 18, 2007 8:23 am Subject: RE: [Jprogramming] Style and Literacy in APL > June Kim > > I don't know much about APL so it is hard for me to understand > > either of the functions. (the author's intention was showing SPD > > being easier to comprehend, though) > > I'm with you there. > > Personally, if I were to implement SPD in J, I'd probably use: > > spd=: [EMAIL PROTECTED] ,/\ ] > > > Now, could anyone help me translating the function spd into J > > (then I might easily translate SPREAD, too)? > > > > (I temporarily put the pdf file for the paper on my server. I might > > remove it in a couple of days. Get it from > > http://agcns.com/p1-berry.pdf ) > > I think I've literally translated SPD as: > > 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 > ) > > Which, again, seems to match your translation (in a later > email). > > However: > 3 (spd -: SPD) 3 4$'can you see ' > 1 > 3 (spd -: SPD) 6 4$'can you see' > 0 > > I'm not sure if my translation is wrong or if SPD fails to satisfy > its declared purpose. My SPD fails, and I suspect that it shares > this property with the original. But I haven't proven to myself > that my translation is perfect. > > P.S. here's how I'd define APL's rho in J; > > rho=: $ :($,) > > FYI, ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
