text=: 1!:1 <'\j601\j.dll' $text 1314816 +/text=LF 3393 text +/@:= LF 3393
ts=: 6!:2 , 7!:[EMAIL PROTECTED] ts '+/text=LF' 0.0078334 2.09837e6 ts 'text +/@:= LF' 0.00239304 1472 ----- Original Message ----- From: Joey K Tuttle <[EMAIL PROTECTED]> Date: Sunday, June 24, 2007 7:20 am Subject: Re: Array vs. Looping examples [was Re: [Jgeneral] J Primer - naive implementation of add 2 lists of numbers] > At 07:46 -0400 2007/06/24, Terrence Brannon wrote: > >On 6/20/07, Devon McCormick <[EMAIL PROTECTED]> wrote: > > > >> > >>I am now working on a paper for APL2007 in which I hope to > provide examples > >>of the clarity loopless > >>programming provides compared to the more conventional variety - > > > >Here's one from Ch. 4 of "Learning J" - > > > >+/ text = LF NB. count the linefeeds in the string > > > >It's amazing how close that is to english: > > > >+/ NB. add up > >text = LF NB. the places where text is linefeed > > > >Staggering. > > > > Time to attach an mp3 with the refrain from "My Fair Lady" - > but we'll have to do with the written verse... > > Eliza: The rain in Spain stays mainly in the plain. > Higgins: I think she's got it. I think she's got it. > Eliza: The rain in Spain stays mainly in the plain. > Higgins: By George, she's got it. By George, she's got it. Now > once > again, where does it rain? > Eliza: On the plain! On the plain! > Higgins: And where's that soggy plain? > Eliza: In Spain! In Spain! > Chorus: The rain in Spain stays mainly in the plain!... ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
