I'll be damned!  Rank 1 _ !  Thank you, Raul.

On 12/7/2011 11:10 AM, Raul Miller wrote:
> Oh, it's certainly doable -- it's that 'simple J' makes some things more
> complicated.
>
> That said, inner product is not very complicated:
>
>     mv =: ([: +/ *)"1
>     mm =: [: |: (mv"2 1 |:)
>
>     $ (i.3 4 5)+/ .*i.5 6 7
> 3 4 6 7
>
>     ((i. 3 4 5) mm  i.5 6 7) -: (i. 3 4 5) +/ .*  i.5 6 7
> |length error: mm
>
>     ((i. 3 4 5) ([: +/ *)"(1 _)  i.5 6 7) -: (i. 3 4 5) +/ .*  i.5 6 7
> 1
>
> And, my other example becomes:
>     ([:<  [: toupper>)"0 'this';'is';'a';'test'
>
> And, in general, artificially restricting vocabulary can make concepts
> clearer.  For example, it can also be instructive to express inner product
> without using J's multiply verb.
>
> However, "instructive" and "simple" are not the same thing.  Also, sticking
> with a single restriction for too long enshrines the restriction and leads
> attention away from the concepts that should have been learned.
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to