I haven't vetted any of these.  I checked a couple edge cases, but no 
guarantees.  Do not use them to control your nuclear
reactor.

For  grp +//. values  :

           NB.  If I'm allowed monadic  =  (self classify)

           grp (+/@#~ =) values    
        
           NB.  If I have to roll my own...

           eq     =.  (] #~ 0 ~: +/@:|:@:]) i.@:# =/ i.~
           grp (+/@#~ eq) values
        
For  b >./;.1 values  :
        
          masks   =.  I.@:[ <:/ i.@:#@:]
          b (] (>./@#~) </\&.|.@:masks) values 

          NB.  This approach even shares the annoying habit of ;.1
          NB.  which discards shards... (length errors not honored)
        
Similarly, for  ; b <@/:~;.1 values  :
        
          living  =.  1 #"0~ +/@:|:
          b (] (living@:] #&:, /:[EMAIL PROTECTED]) </\&.|.@:masks) values 

For those who find this thread interesting, you may also like  
http://www.jsoftware.com/jwiki/PrimitivePrimitives  .

-Dan

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

Reply via email to