A lean version:

   train=. evoke&6
   ( shortcircuit=.(power&:train~)`(at&:train~)/ o |. ) v0`t0`v1`t1`v2`t2
v0^:t0@:v1^:t1@:v2^:t2

   ShortCircuit=. shortcircuit f. sv

   [: v0 t0 v1 t1 v2 t2 v3 t3 v4 t4 ShortCircuit
v0^:t0@:v1^:t1@:v2^:t2@:v3^:t3@:v4^:t4




On Wed, Mar 5, 2014 at 2:08 PM, Jose Mario Quintana <
jose.mario.quint...@gmail.com> wrote:

> Pascal wrote:
>
> >the above is not a useless pattern, but it would still be nice to have a
> real short circuit.
>
> >the pattern:  doN^:testN...@:do2^:test2@:do1^:test1
>
> >might be implementable using clever `:3, and ^:`@: but its not
> >straightforawd to
>
>
> This is one way (using verbalized adverbs and conjunctions [1,2]):
>
>
>    train=. (evoke&6) :. (tie&'')
>
>    ( shortcircuit=.train o ((power&.:train ~)`(at&.:train ~)/) o |.)
> v0`t0`v1`t1`v2`t2
> v0^:t0@:v1^:t1@:v2^:t2
>
>    ShortCircuit=. shortcircuit sv
>
>    [: v0 t0 v1 t1 v2 t2 v3 t3 v4 t4 ShortCircuit
> v0^:t0@:v1^:t1@:v2^:t2@:v3^:t3@:v4^:t4
>
>
> (Stay tuned for the release...)
>
> [1] Tacit recursion without $:
> http://www.jsoftware.com/pipermail/programming/2014-March/035662.html
> [2] Tacit recursion without $:
> http://www.jsoftware.com/pipermail/programming/2014-March/035662.html
>
>
>>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to