Oh, my mistake -- your data is NOT complex.  I mistook the  16  in

>       +--+-+-+--+
>       |16|4|4|16|
>       +--+-+-+--+

to be the result of  3!:0  , but of course it's the result of $  . So now I can 
reproduce your results in J5.  I bet I know what the bug is:

   http://www.jsoftware.com/pipermail/general/2005-September/024453.html

Which, as you can see, was fixed for J6. 

The problem is that not only are  p1  and  p2  identical in internal 
representation, they're identical in memory location. That is, they are both 
pointers to the same structure.  So, an even simpler demonstration of the bug 
would be:

           e.~ p1
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

or, simpler yet,

           e.~ 0 4  NB.  Has to have at least 2 elements whose difference is at 
least  4
        0 0
   
Were they assigned at the same time?  Was one assigned from the other?   In 
either case, the simplest fix is to copy one name back to itself (in a way that 
actually copies the data, and not just re-points to it):
    
           p1 e. p2
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
           p2 -: a: { p2  NB.  a: {  copies.
        1
           p2 =. a: { p2  
           p1 e. p2
        1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
           
Hope this helps,

-Dan


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

Reply via email to