oleg,
 - you have a C main app,
yes.
 - define function sum (of int array returning int scalar)
yes.
   and pass it to J
yes.
 - form int array and pass it to J
nope...

after i register sum with j, i go into a REPL,
just like jconsole.  here's my comments on my
main():

{cd(jsj("",0));                    initialize
sfn("sum",(J(*)(void))sum,1);     register sum
{C b[99];while(gets(b))           while read a line into b
 {J r=jsj(b,0);                     execute the line
  if(Nt==r->t&&NULL!=r->d)          if error
    eO("! %s\n",r->d);                print error
  else                              else
    show(r);                          show result
  cd(r);                            decrement ref count on result
}}}

the first thing i would try in the REPL
is "sum i.4"


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

Reply via email to