"So, we often hear complaints that J is terse to the point of being cryptic. That it is unreadable. Let's see if that's true."
I guess there are a lot of readers who think this line is cryptic and unreadable. It would be good to explain what it is doing step by step load'trace' trace'(#~ ] -.@:e. [: , */~)@:(2 + i.) 12' --------------- 5 Trident ---- 2 + i. 2 + i. --------------- 8 Paren ------ ( 2 + i. ) 2 + i. --------------- 3 Adverb ----- * / */ --------------- 3 Adverb ----- */ ~ */~ --------------- 5 Trident ---- [: , */~ [: , */~ --------------- 4 Conj ------- -. @: e. -.@:e. --------------- 5 Trident ---- ] -.@:e. [: , */~ ] -.@:e. [: , */~ --------------- 3 Adverb ----- # ~ #~ --------------- 6 Bident ----- #~ ] -.@:e. [: , */~ #~ (] -.@:e. [: , */~) --------------- 8 Paren ------ ( #~ (] -.@:e. [: , */~) ) #~ (] -.@:e. [: , */~) --------------- 4 Conj ------- #~ (] -.@:e. [: , */~) @: 2 + i. (#~ (] -.@:e. [: , */~))@:(2 + i.) --------------- 0 Monad ------ (#~ (] -.@:e. [: , */~))@:(2 + i.) 12 2 3 5 7 11 13 ============================== 2 3 5 7 11 13 2008/4/4, Dan Bron <[EMAIL PROTECTED]>: > > Henry wrote: > > Finds primes less than y. > > > Ah, vindication! If you wanted to be more precise: > > it returns a vector of primes less than y+2 (i.e., > if y+1 is prime, it is returned), sorted according > to the sign of y (if y>0 implies /:~ and y<0 > implies \:~ ) > > And there actually may be more hidden depths for weirder arguments. Not > sure. > > Is anyone interested in posting a more difficult challenge? > > > -Dan > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Björn Helgason, Verkfræðingur Fugl&Fiskur ehf, Fornustekkum II, 781 Hornafirði Po Box 127,801 Selfoss , t-póst: [EMAIL PROTECTED] gsm: +3546985532 Landslags og skrúðgarðagerð, gröfuþjónusta http://groups.google.com/group/J-Programming Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans góður kennari getur stigið á tær án þess að glansinn fari af skónum /|_ .-----------------------------------. ,' .\ / | Með léttri lund verður | ,--' _,' | Dagurinn í dag | / / | Enn betri en gærdagurinn | ( -. | `-----------------------------------' | ) | (\_ _/) (`-. '--.) (='.'=) `. )----' (")_(")
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
