On 2/13/08, Dan Bron <[EMAIL PROTECTED]> wrote:
> Or, more generally,
>     ({.data)=:<"_1|:}.data

I wrote:
>     ({.data)=:<"_1|:}.data

Raul asked:
> Have you tested this?

Nope.  

I've used the idiom  <"_1 |:  before with success, but I think in a
different context; in any case when modifying your code I didn't even notice
the LHS.

So how about this?

           (, {.data)  =.  ,  (<@:,;.1~ a: , (<1) #~ _1 + #@:$) }. data
   
This time, I did test:

           nms  =:  {&.:(;: :.;&.>)'a b c';'d e f'
           dta  =:  <"0 i. 3 3 3
           
           data =: nms,dta
           
           (, {.data)  =.  ,  (<@:,;.1~ a: , (<1) #~ _1 + #@:$) }. data
           
           ad
        +-+-+--+
        |0|9|18|
        +-+-+--+
           cf
        +-+--+--+
        |8|17|26|
        +-+--+--+
           
The only real wart is those final ravels.  They're necessary because the LHS
and RHA must agree in shape, and multidimensional LHA are prohibited
(probably specifically because of this assignment-opens issue).

-Dan
-- 
View this message in context: 
http://www.nabble.com/Where-to-put-user%27s-own-libraries--tp15397664s24193p15466939.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to