Hey,
I have a bit of code I want to include into something large, but I'm hitting a
wall.
({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1(|:@,:1:))50 25 33 22 293
1 2 1 1 3
Okay. Slap on some parens, and it fails? Valence error for {:..? Both resolve
to 3, a verb, according to 4!:0. Because both verbs are monadic, I tried
capping either and both, all composing conjunctions, parenthesizing. Adding in
]. or [., I don't see what the problem is, or how tail's valence fits into it?
Some configurations increase the dimensions and don't give out the desired
thing:
(({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1 @ (|:@,:1:))50 25 33 22
293
1 0
0 0
1 1
0 0
1 0
0 0
1 0
0 0
1 1
1 0
However, assigning both to names and composing does work
q=:|:@,:1:
w=:({:`([:$:0 1&+)@.(9&<@{.)@(([:*/"."0@":@{.),{:))"1
w q 50 25 33 22 293
1 2 1 1 3
(w@q)50 25 33 22 293
1 2 1 1 3
What am I missing? This to me is unexpected behavior. I expect parethesization
and variable substitution to be identical, but it's not. I'm sure there's a
single, explanatory/exculpatory line somewhere about assignments, variables and
or parentheses on the wiki, but it's not easily discoverable..
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm