I can't reproduce your results on my machine. Here's a run on mine:
JVERSION
Installer: j602a_win64.exe
Engine: j602/2008-03-03/16:45
Library: 6.02.023
ts =: [: ;:^:_1 ('/sec';'MB') ,&.>~ ('0';'0.3') 8!:0 %@:(6!:2) , 1e_6 *
7!:2@:]
10 ts '(3 : '' ( -: a) + b + (+: c) [ ''''a b c'''' =. y'')"1 ] 1e5 3 $
;/ i.37'
1/sec 7.722MB
10 ts '( -:@>@{: + >@(1&{) + +:@>@{:)"1 ] 1e5 3 $ ;/ i.37'
3/sec 7.713MB
D=:1e5 3 $ ;/ i.37
10 ts '(3 : '' ( -: a) + b + (+: c) [ ''''a b c'''' =. y'')"1 D'
1/sec 1.062MB
10 ts '( -:@>@{: + >@(1&{) + +:@>@{:)"1 D'
5/sec 1.055MB
D2=:1e5 3 $ i.37 NB. Boxes superfluous
10 ts '(3 : '' ( -: a) + b + (+: c) [ ''''a b c'''' =. y'')"1 D2'
1/sec 1.062MB
10 ts '( -:@>@{: + >@(1&{) + +:@>@{:)"1 D2'
4/sec 1.055MB
NB. More direct approach
10 ts '0.5 1 2 +/@:*"1 D2'
16/sec 1.053MB
10 ts '0.5 1 2 +/ .* |:D2'
117/sec 9.441MB
NB. Define D more naturally for use-case
D3=:|:D2
10 ts '0.5 1 2 +/ . * D3'
429/sec 5.246MB
-Dan
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Pascal Jasmin
Sent: Monday, November 04, 2013 5:04 PM
To: [email protected]
Subject: Re: [Jprogramming] weird syntax error
sorry, I found it right after sending, but here is another stumper
also,
ts '(3 : '' ( -: a) + b + (+: c) [ ''a b c'' =. y'')"1 ] 1e5 3 $ ;/ i.37'
needs to be:
ts '(3 : '' ( -: a) + b + (+: c) [ ''''a b c'''' =. y'')"1 ] 1e5 3 $ ;/
i.37'
2.17296/sec 4.3856MB
and just fyi, the point of why I was doing that, the equivalent tacit form
timing:
ts '( -:@>@{: + >@(1&{) + +:@>@{:)"1 ] 1e5 3 $ ;/ i.37'
9.2746/sec 4.38099MB
----- Original Message -----
From: Michael Dykman <[email protected]>
To: J Programming <[email protected]>
Cc:
Sent: Monday, November 4, 2013 4:56:01 PM
Subject: Re: [Jprogramming] weird syntax error
double your quotes when inside quotes.
t =. 3 : ' ( -: a) + b + (+: c) [ ''a b c'' =. y'
On Mon, Nov 4, 2013 at 4:53 PM, Pascal Jasmin <[email protected]>wrote:
> I'm likely doing something silly, but I just don't see the mistake:
>
> (-: a)+b++:c [ 'a b c' =. ;/ 1 2 3
> 8.5
> t =. 3 : ' ( -: a) + b + (+: c) [ 'a b c' =. y'
> |syntax error
> | (-:a) +b+(+:c)[
>
> is it trying to form a train with [ as the rh most verb?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
- michael dykman
- [email protected]
May the Source be with you.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm