Arc Forumnew | comments | leaders | submitlogin
4 points by jsgrahamus 2768 days ago | link | parent

This works for me in anarki, which is the community edition of arc:

  steve@steve-Satellite-L555D:~/anarki$ cat test.arc
  (prn "hello, world!")
  (quit)

  steve@steve-Satellite-L555D:~/anarki$ ./arc.sh test.arc > test.out

  steve@steve-Satellite-L555D:~/anarki$ cat test.out
  hello, world!

  steve@steve-Satellite-L555D:~/anarki$ 
Not sure how to do pass an file name to arc itself.


4 points by akkartik 2767 days ago | link

You're almost there. To pass in to Arc a filename argument to write to, you'd say this:

  $ cat test.arc
  (tofile (argv 1)
    (prn "hello, world!"))
(The quit is unnecessary since Arc will automatically quit after running all commands in batch mode.)

  $ ./arc.sh test.arc test.out
  $ cat test.out
  hello, world!
argv is a list containing commandline arguments, and tofile redirects prn to some given filename.

-----