Not a bug: when x/y are absent the body of the modifier (which may be long) is executed as soon as it has its verb arguments. At that point in parsing Roger doesn't know whether the result is going to be a monad or a dyad. It may not even have any verb operands at all when it is parsed, and it must be parsed right then because it might return something other than a verb.
Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Dan Bron > Sent: Thursday, November 22, 2007 6:24 PM > To: [email protected] > Subject: Re: re[Jgeneral] duce/fold in J as an adverb or conjuction > > > 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-conjuct ion-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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
