On Fri, Mar 18, 2011 at 11:23 AM, Raul Miller <[email protected]> wrote: > On Fri, Mar 18, 2011 at 11:12 AM, Tracy Harms <[email protected]> wrote: >> I don't understand why the following two verbs don't work identically. >> >> The result of the first one is what I intend. The form of the second is what >> I prefer. >> >> dyadicForm=: [ I.@:] } -.@:] >> 4 dyadicForm 0 1 1 0 1 0 0 1 >> 4 0 0 4 0 4 4 0 >> >> monadicForm=: +/ I. } -. >> monadicForm 0 1 1 0 1 0 0 1 >> 4 0 0 1 0 1 1 0 > > You are using http://www.jsoftware.com/help/dictionary/d530v.htm in > the second case but I believe you were expecting this version to have > the same behavior as > http://www.jsoftware.com/help/dictionary/d530n.htm except with the > verb result in place of the noun. > > Possible alternatives include: > monadicForm1=: +/@]`(I.@])`]}~ > monadicForm2=: * +/
Oops: monadicForm2=: -. * +/ I am also a little unclear, myself, on why the mechanics of v} are the way they are. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
