Richard Vaughan wrote:
>   x=.1200$<' '
>   7!:5 <'x'
>8192

>   x=.1200$<32{a.
>   7!:5 <'x'
>84992

I think this observation can be reduced to:

           a  =.  ' '
           b  =.  32{a.
           
           7!:5 <'a'
        0       
           7!:5 <'b'
        64
           
I guess there's some special treatment of the token  '  '  .

Still, I'm surprised by your second observation, as I thought that the 
expression  x $ < y  was optimized by creating an array of pointers to the same 
box, rather than copying the actually data.  As in:

           z=.i. 1000 1000
           7!:5<'z'
        4.1943e6
           
           Z=.1 $ z
           7!:5<'Z'
        4096
           
           Z=.4 $ z
           7!:5<'Z'
        16384
           
           Z=.4 4 4 $ z
           7!:5<'Z'
        262144
          
-Dan

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

Reply via email to