Arc Forumnew | comments | leaders | submitlogin
4 points by jsgrahamus 856 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!")

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

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

Not sure how to do pass an file name to arc itself.

4 points by akkartik 856 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.)

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