Raul provided:
> R=:1 :0
> u~/@|.@([EMAIL PROTECTED]@]`0:`]}~) y
> :
> x u~/@|.@((u {.)`0:`]}) y
> )
> I have to include explicit x and y to achieve proper monad/dyad
> behavior
Yes, I'm pretty sure the following behavior is a bug:
R2 =: 1 : 0
u~/@|.@([EMAIL PROTECTED]@]`0:`]}~)
:
u~/@|.@((u {.)`0:`]})
)
+ R2
+~/@|.@([EMAIL PROTECTED]@]`0:`]}~)
Note that the dyadic valence isn't present in the derived verb. The result
of + R2 should have been:
+~/@|.@([EMAIL PROTECTED]@]`0:`]}~) :(+~/@|.@((+ {.)`0:`]}))
We can work around this:
R3 =: 1 : 'u~/@|.@([EMAIL PROTECTED]@]`0:`]}~)
:(u~/@|.@((u{.)`0:`]}))'
but we shouldn't have to. I don't want to be required to mention the
explicit x and y or be forced to write a dense explicit ambivalent
operator employing the : conjunction.
-Dan
Another bug:
R4=:1 :0
:
u~/@|.@((u {.)`0:`]})
)
+ R4
|domain error: R4
| +R4
NB. Why the error?
R4
1 : ' u~/@|.@((u {.)`0:`]})'
+ 1 : ' u~/@|.@((u {.)`0:`]})'
+~/@|.@((+ {.)`0:`]})
NB. Apparently _not_ identical to R4, despite its display.
+(5!:1{.;:'R4')5!:0
+~/@|.@((+ {.)`0:`]})
NB. (5!:1{.;:'f') 5!:0 is supposed to be identical to f,
NB. but in this case it isn't.
NB. Summary of the bug:
+ 1 : (':';'u~/@|.@((u {.)`0:`]})')
|domain error
| +1 :(':';'u~/@|.@((u {.)`0:`]})')
--
View this message in context:
http://www.nabble.com/reduce-fold-in-J-as-an-adverb-or-conjuction-tf4839217s24193.html#a13904865
Sent from the J General mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm