Eric wrote:
>I've never heard of the non-unique sparse elements bug. Do you have a way to 
>produce this on demand?

Sure.  In j.exe (not jconsole.exe, nor j.jar) for any J6 beta (not J5), run the 
following sentences.  I've elided the output, but for obvious reasons, you 
should not suppress it.

           (9!:12 (, ' ; ' &, )&": 9!:14) ''  NB.  Windows ; J6
        6 j601/beta/2006-05-20/22:30
        
           wd'qwd'               NB.  j.exe (not jconsole.exe nor j.jar)
        jwin32
        
           boxdraw_j_ 0          NB.  Have to have unicode boxes; ASCII just 
causes 'too much data' error.
        
           9!:37 ] 0 1024 300 0  NB.  Long, wide output.
        
           <">  i. 1024 300      NB.  Big boxed display
        ...
           <">  i. 1024 300      NB.  And again
        ...

           wdhandler''           NB.  Calling  wdhandler''  directly only 
results in 'too much data' 
        |domain error: wd
        |   wdq=:    wd'q'
        
           NB.  Instead, press ESC, or F12, or mouse-click on the little [x], 
etc.
           NB.  Basically, do anything that causes the a windows message loop 
event.
        |non-unique sparse elements: wd
        |   wdq=:    wd'q'

           wdhandler''           NB.  After its first appearance, any call to 
wd 'q' fails with the sparse error
        |non-unique sparse elements: wd
        |   wdq=:    wd'q'   
           
           11!:0 'q'
        |non-unique sparse elements
        |       11!:0'q'


My speculation is that (A) you're using a sparse array to store the  wd  data, 
to leverage the fact that spaces are common, and (B) the error message is due 
to the split personality of unicode characters.  What I mean by (B) is that 
they look like one character, but they're treated like several:

           #'?'
        3

If that character doesn't come through email correctly, it is a copy-and-pasted 
 u:16  (the top-left corner box drawing character).  But do not think:

           #u:16
        1

is equivalent.  It is not; you must literally copy and paste the result of  
u:16  , put quotes around it, and put a  #  in front. (the character is really  
2 u: u: 226 148 140  ).   This has been discussed previously on the Forums.  
I'll dig up a link if you ask.

Anyway, since the bug requires  boxdraw 0  and since sometimes single unicode 
characters are really multiple characters, I speculate this message is just:

           ($.i.4)  {  226 ,. i. 4
        |non-unique sparse elements
        |   ($.i.4)    {226,.i.4
           
in disguise (contrast with examples in postscript).

-Dan

PS:

           (   i.4)  {         i.4
        0 1 2 3
        
           (   i.4)  {    0 ,. i.4
        0 0
        0 1
        0 2
        0 3
        
           (   i.4)  {  226 ,. i.4
        16 0
        16 1
        16 2
        16 3
            
           ($. i.4)  {         i.4
        1 | 1
        2 | 2
        3 | 3
           
           ($. i.4)  {    0 ,. i.4
        1 | 0 1
        2 | 0 2
        3 | 0 3

(I am not saying the actual value  226  is special or relevant.)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to