Arc Forumnew | comments | leaders | submitlogin
3 points by eds 6100 days ago | link | parent

On Anarki, arc-exe.scm can be used to execute files containing arc code, much like with conventional scripting languages.

If test.arc contains

  (prn "hello world!")
then on the command line you could type

  > mzc --exe arc arc-exe.scm
to create an standalone arc executable and

  > arc test.arc
  hello world!
to run test.arc through the arc executable you just made.

It might also be nice to have this feature in as.scm.



2 points by shlomif 6098 days ago | link

"It might also be nice to have this feature in as.scm."

I added this feature to as.scm in git-wiki/Anarki about two days ago.

-----

2 points by tiglionabbit 6100 days ago | link

What about on a mac? I was just told that this works: mzscheme -m -f as.scm < myprogram.arc

-----

3 points by sacado 6099 days ago | link

It does work, but don't do that :) At least if you're generating, for example, very big lists : everything evaluated in your program will be displayed. If your code contains something like (= foo (range 1 1000000)), you'll somewhat regret it...

But, in many cases, that will work just fine, despite the noise generated by the repl. You can also do mzscheme -m -f as.scm < myprogram.arc >/dev/null to turn the whole output off (in case you don't need it at all).

-----

2 points by absz 6099 days ago | link

Or wrap your whole program in a (do ... t) block, which is what I do. No change in semantics, and everything works fine.

-----

3 points by eds 6100 days ago | link

I believe the mzc compiler works on mac. (I'm not talking about exe's in the Windows sense here.)

Yes, that works, if you don't mind command-line hacks.

-----