Pascal wrote:
"
So, I'm no longer sure there is a way to tacitly break execution on the
first fail test.  Or actually, I need to paren the whole left side of any
^: ... which was probably a needed manipulation function anyway.

"

Yet, your original pattern does that,

   u=. v0^:t0@:v1^:t1@:v2^:t2@:v3^:t3@:v4^:t4

   5!:6@<'u'
((((((((v0^:t0)@:v1)^:t1)@:v2)^:t2)@:v3)^:t3)@:v4)^:t4


Am I missing something?




On Wed, Mar 5, 2014 at 9:24 PM, Pascal Jasmin <godspiral2...@yahoo.ca>wrote:

>
>
> Looks nice.  Here is a continuation of my gerund manipulation approach:
>
> conjoin=:  (,@:[ <@:; <@:])"1
>
>   ('@' conjoin -.`*) `:6
> -.@*
>
>  '@' conjoin (-.`'') ," 1 ,. *`-`+
> ┌──────────┬──────────┬──────────┐
> │┌─┬──────┐│┌─┬──────┐│┌─┬──────┐│
> ││@│┌──┬─┐│││@│┌──┬─┐│││@│┌──┬─┐││
> ││ ││-.│*││││ ││-.│-││││ ││-.│+│││
> ││ │└──┴─┘│││ │└──┴─┘│││ │└──┴─┘││
> │└─┴──────┘│└─┴──────┘│└─┴──────┘│
> └──────────┴──────────┴──────────┘
>
> stitchtrains =: ,.&(G2train@:(<"1))
>
>    (-.`'') stitchtrains ,. *`-`+
> ┌──┬─┐
> │-.│*│
> ├──┼─┤
> │-.│-│
> ├──┼─┤
> │-.│+│
> └──┴─┘
>
>  ('@' conjoin (-.`'') stitchtrains  *`'') `:6
> -.@*
>
> G2train turns out to be a pretty good idea for working with informal lists
> of verbs and combining them into trains/tacit definitions.  But working
> with tables of gerunds is a bad idea bc `:6 fails when a:/fills are present.
>
> To complete my last example:
>
> shortcircuits =:  ((,'@:'); [<@:;])/ @:(_2&}. , (,'@:') <@:; _2&{ <@:, {:)
>
> (< shortcircuits  '^:' conjoin  (]`>vvtie"1 0]9 12 2) stitchtrains~
> ]`+vvtie"1 0]5+i.3) `:6
> (] + 5"_)^:(] > 9"_)@:((] + 6"_)^:(] > 12"_)@:((] + 7"_)^:(] > 2"_)))
>
>
> AndDoTrains =: ([: <@:shortcircuits  '^:' conjoin  [ stitchtrains ])
>
>    ( (]`>vvtie"1 0]9 12 2) AndDoTrains~ ]`+vvtie"1 0]5+i.3)`:6
> (] + 5"_)^:(] > 9"_)@:((] + 6"_)^:(] > 12"_)@:((] + 7"_)^:(] > 2"_)))
>
> though it turns out this was the wrong spec, as it has the same result as
> the [: version (fails > 12, but still execs later >9)
>
>    ( (]`>vvtie"1 0]9 12 2) AndDoTrains~ ]`+vvtie"1 0]5+i.3)`:6"0  ] 1 2 3
> 4 5 6
> 1 2 15 16 17 24
>
> So, I'm no longer sure there is a way to tacitly break execution on the
> first fail test.  Or actually, I need to paren the whole left side of any
> ^: ... which was probably a needed manipulation function anyway.
>
>
>
>
>
>
>
> _____________________
>   ( 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
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to