[Jprogramming] an apparent inconsistency

Raul Miller rauldmiller at gmail.com
Fri Mar 18 23:23:17 HKT 2011


On Fri, Mar 18, 2011 at 11:12 AM, Tracy Harms <kaleidic at gmail.com> 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=: * +/

-- 
Raul


More information about the Programming mailing list