On 4/17/07, bill lam <[EMAIL PROTECTED]> wrote:
this is incorrect because it should be parsed as two commands.
Oops, I was not thinking clearly. Here's a fixed version:
wdstates=:".;._1;._2(0 :0)
, 1 1, 2 1, 3 1, 4 1, 5 1 NB. start wd statement parse
, 1 2, 2 2, 3 2, 4 2, 5 2 NB. ; ends wd statement
, 2 0, 5 0, 2 0, 2 0, 2 0 NB. " ends wd " quoted word
, 3 0, 3 0, 3 0, 3 0, 3 0 NB. * finishes array as a parameter
, 4 0, 4 0, 4 0, 5 0, 4 0 NB. DEL ends DEL quoted word
, 1 0, 2 0, 3 0, 4 0, 5 0 NB. other characters
)
wdel=: a.{~127+128*'5'=1{9!:14''
wderrok_z_=: 0 0 $ [: 11!:0 ::0:&> (0;wdstates;(';"*',wdel)i.a.) ;: ]
I'm not skeptical on your parser, but the in-efficiency from repeated calling wd
rather than calling once only.
Sure.
Personally, I suspect J's invocation overhead is trivial compared to the
OS overhead involved in defining and supporting its UI objects.
Or, at least, I've seen other windows applications taking a long time
to start when they didn't really have anything to do other than initialize
their GUIs.
But all this is speculation -- useless without actual measurements.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm