Roger wrote:
> x (m&v) y gives exactly
> the same results whether
> m&v has ranks 0 _ or _ _
Wrong.
The phrase (3:`4:) m&v y has a meaningful interpretation if m&v has rank _
_ _ . But if m&v has rank _ 0 _ then the phrase is an error.
Similarly, if m&v has rank _ 0 _ then (3;4) m&v y has a meaningful
interpretation, but with rank _ _ _ it is an error.
Despite this congruence of errors, having m&v be rank _ _ _ is preferable
because it is trivial to a change verb with rank _ _ _ into a verb with rank
_ 0 _ , but not vice versa.
Further, ignoring the semantics of m&v , there is an issue of performance.
The expression u^:vector can be optimized by applying u a maximum of
>./vector times. If ^: can only see a scalar at a time, no such
optimization is possible.
That said, it appears that despite:
3&+ b. 0
_ 0 _
the verb m&v is "really" rank _ _ _ :
(3:`4:) 3&+ (12)
13
(3:`4:) 3&+"_ 0 _ (12)
|length error
| (3:`4:) 3&+"_ 0 _(12)
(3 ;4 ) 3&+ (12)
|domain error
| (3;4) 3&+(12)
(3 ;4 ) 3&+"_ 0 _ (12)
12 15 18 0
12 15 18 21
se =: 4 : 'noun =: >: noun'
1 3 1 3 'a'& se noun =: 0
1 3 1 3
1 3 1 3 'a'& se"_ 0 _ noun =: 0
1 4 5 8
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm