I wrote:
>  zUr6 =: $:&1 0 : ((, 1 , 0 #~ 1 = ({~ +/))@:]^:[)

Finally, to tie this up with a little bow:

           zUr7 =: (, 1 , 0 #~ 1 = ({~ +/))@:]^:( ]`(1 0"_) )
        
           zUr7 7
        1 0 1 1 0 1 0 1 1 0 1 1 0
        
           (zUr -: zUr7) 100
        1
           
I think this is a superior definition, even at the expense of reintroducing 
`  (which primitive itself you weren't complaining about anyway).   

I say that because  zUr6  is no longer as general as the original  zUr  . 
The  1 0  sequence seed is now mandatory because  +/  depends upon it for
correct index calculation.  And, since it is no longer optional, it should
be bound, not provided as a default.  This verb,  zUr7  , enforces that
requirement.

-Dan
-- 
View this message in context: 
http://www.nabble.com/How-to-behead-included--tf4778131s24193.html#a13672345
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