[Jprogramming] Re: Example of 2!:2

Joey K Tuttle jkt at qued.com
Mon May 28 22:20:18 HKT 2007


At 08:50  +0200 2007/05/28, david alis wrote:
>>Joey K Tuttle (Mon May 28 00:52:42 HKT 2007) wrote:
>>...
>>I agree with Raul that you have a wayward ' in your j expression.
>>     'a b c' =. 2!:2 '/usr/bin/perl -n -e  "print" '
>>     a
>>2556
>>etc etc...
>1)
>The problem isn't the wayward quote - running the expression above also
>causes j to vanish.
>When this happens the system produces messages and a memory dump.
>Depending whether I am running jconsole of jw, the message starts:
>*** glibc detected *** jconsole" double free or corruption (!prev): 
><an address>
>*** glibc detected *** java" double free or corruption (!prev): <an address>
>etc..
>(I am running Ubuntu 7.04 64bit)
>
>
>2)
>Re Joey's:
>    'Where does this go?' 1!:2 b
>    1!:1 c
>|limit error
>|       1!:1 c
>
>Would using the expression 1!:11 c have made any difference?
>
>3)
>Yes - the motive would be to use pipes to connect to unix processes...
>but I take care before assuming that there is always a performance gain:
>For example setting hostexpr =: 'cat filename | tr -d "\n\r" '
>and comparing
>time 'data =: (2!:0) hostexpr'
>time 'data =: CRLF -.~ (1!:1) <filename'
>I learnt that, for a 190Meg file, j is nearly 3x faster than the host.
>

On your last point, I agree and have had similar
experiences myself. I'm working on a wiki page for
one of them.

I tried 1!:11 c;0   but that just got index instead of limit error...

On my system, unbalanced quotes was the answer from literally taking
your line from the first item. Maybe be a bug lurking in 64 bit support.

- joey


More information about the Programming mailing list