--- On Mon, 4/28/08, Raul Miller <[EMAIL PROTECTED]> wrote:

> On 4/28/08, Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
> >   bi=: <\ [EMAIL PROTECTED]     NB. boxed indecies
> >   gt=: >/          NB. greater than
> >   repair=: C.~ _2&(gt\ # bi)
> 
> Oleg Kobchenko:
> 
> With verbs like _2 v\ ] you need to handle length 1
> fragments
> 
> For example:
> 
>    gt=: >/          NB. greater than
>    bi=: <\ [EMAIL PROTECTED]     NB. boxed indecies
>    repair=: C.~ _2&(gt\ # bi)
>    bubsort=: repair @ ({. , [EMAIL PROTECTED])^:_
>    bubsort -i.9
> |domain error: repair

which can be easily fixed
   gt=: {. > {:
   bubsort -i.9
_8 _7 _6 _5 _4 _3 _2 _1 0

> However:
>    repair=: ] C.~ _2 (([EMAIL PROTECTED]: /:~)\ # (<\ [EMAIL PROTECTED]))
> ]
>    bubsort -i.9
> _8 _7 _6 _5 _4 _3 _2 _1 0



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to