How can I run Arc as a script instead of a REPL? For instance, suppose I want to use an Arc script in a Unix pipeline or cron job. To make this concrete, suppose I want a trivial script:
$ ls | arc-word-count-script
42
or even more trivially:
$ arc-hello-world-script
hello world
What magic needs to go in arc-hello-world-script? The following is close, but outputs a couple lines of junk:
Thank you! That's hugely helpful! I have to say, though, that 11 lines of boilerplate kind of obliterates Arc's conciseness advantage in the Arc Challenge :-)
Not really, the Arc Challenge specifically discounts code for setting up libraries. All the script is doing is setting up libraries and loading your code.
Is there a way to execute a script that a) runs some arc or scheme code (specifically "(thread (asv))" or similar) and then b) starts the repl? Do I just change your main.arc to run the arc code I want, and then call ($ (tl))?