'*' (I.,b)"_} a

Not just in this specific case but in general it is
better to use i.$y as the canonical indices rather
than {i.&.>$y .  The latter takes orders of 
magnitude more time and space for no extra benefit.

Of course if we are talking about just this specific
case,  b{'-*'  would do. :-) Anyway it would be 
prudent to use non-atomic x in talking about x m}y 
lest one is misled by properties that are absent 
for more general x .



----- Original Message -----
From: Andrew Nikitin <[EMAIL PROTECTED]>
Date: Friday, July 21, 2006 11:18 am
Subject: [Jprogramming] RE: }

> Brewer, Andrew:
> >R.E.,
> >I've found { kind or useful for working with amend, but keeping 
> the array 
> >structure intact (maybe helpful for amend in-place?)
> >
> >For example:
> >
> >    indexes =. , @ { @: (i.each) @ $
> >    ] a =: 5 9 $ '-'
> >    ] b =: ? ($a) $ 2
> >    ] a =: '*' ( (,b) # indexes a ) } a
> >***--***-
> >**---**--
> >---*--*--
> >*-***--**
> >**-*-****
> 
> In this specific case is no need for special 'indexes' verb; i. 
> will do just
> fine (with some magic):
> 
>   '#' ( b #&, i.$ a )"_ } a
> ----##--#
> #-##-##--
> ###--####
> #--#-#-#-
> -####---#


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

Reply via email to