Thank you.  I'll reread the special code optimizations section.
When I insert my favorite side effect hook ([smoutput), emacs tells me that j did all the computations. It did not stop at finding the first matching index.

   #~. , */~ 100+i.900
   227521

   ({~ (-: |.)@([smoutput)@":"0 i. 1:)  \:~ ~. , */~ 100+i.900
...Region has 227520 lines, 227520 words,...
906609


>Date: Sun, 8 Jun 2014 20:25:01 -0700 (PDT)
>From: "'Pascal Jasmin' via Programming" <[email protected]>
>To: "[email protected]" <[email protected]>
>Subject: Re: [Jprogramming] Project Euler Question 4
>Message-ID:
> <[email protected]>
>Content-Type: text/plain; charset=iso-8859-1
>  timespacex '(* (-: |.)@":)@:[^:(0=])/ 0,~ /:~ ~. , */~ 100+i.900'
>0.167316 3.56726e7
>
>btw, there is an optimization close to short circuiting built in:
>
>   ({~ (-: |.)@":"0 i. 1:)  \:~ ~. , */~ 100+i.900
>906609
>
>   timespacex '({~ (-: |.)@":"0 i. 1:)  \:~ ~. , */~ 100+i.900'
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to