R.E. Boss wrote:

>As I see it, you amend d by 1(0)}d but you don't use d anymore (in fw2dl),
>is that correct?

Nope, it's not correct. You found a bug! 

The line after  d =. 1 (0)} d  should have used  d  as a left hand argument.  
So the complete function should have been:

        fw2dl =: verb define
         
          TAB fw2dl y
        
        :
                s =. y ~: ' '
                d =. y e. LF,x
        
                l =. d ([: ; <@(+./\ );.2) s
        
                d =. 1 (0)} d  
NB.             t =. s ([: ; <@(+./\.);.1) s   NB.  <-- Buggy version
                t =. d ([: ; <@(+./\.);.1) s 
                
                e =. l*.t
                y =. e#y
        
        )

Thanks for noticing this and pointing it out!  This was in production code!  
I'm actually surprised the script didn't break. 

I guess next time I'll choose variable names seperated by more one key.  
Brevity has its drawbacks, too.

-Dan

PS to R.E. Boss:  Sorry if you get multiple copies of this message, I'm having 
serious email problems at home.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to