Arc Forumnew | comments | leaders | submitlogin
Running arc from outside the arc2.3 dir?
2 points by markjreed 904 days ago | 4 comments
Is there any envar or command-line option that I can use to tell arc where to find its files to `(aload)` so that I can launch it from other directories? Right now I have to cd into the arc2.3 dir, which means I lose my previous filesystem context...


2 points by zck 903 days ago | link

What OS are you on? If you're on Linux or MacOS, you can use `pushd` and `popd`.

On bash, I have some aliases set up. they will move you to the right directory, run arc or anarki, then when it exits, move you back to the original folder.

alias arc="pushd ~/programs/arc/arc3.2/; rlwrap racket -f as.scm; popd" alias anarki="pushd ~/programs/arc/anarki/; ./arc.sh; popd"

I normally use fish shell, but functions there are simple enough to make based on the bash aliases.

-----

2 points by markjreed 902 days ago | link

Getting back after arc is not the problem; even if I didn't have cd history set up a simple `cd -` would handle that.

Simple problem: I have a file containing a program written in Arc. I want to run it from the shell. How do I do that? I can fire up arc and `(load)` the file, but then the file needs to be in the arc2.3 dir or else I have to load it by absolute path, even if I was just in the same directory it's in.

For now I've just switched to using Anarki; I can run its `arc.sh` start script from anywhere in the filesystem and feed it a locally-relative pathname and it will run. Although it does seem to take quite a lot longer to start up than arc.

-----

1 point by akkartik 902 days ago | link

I don't recall the details atm, but I believe https://github.com/arclanguage/anarki does this correctly. Can you check? Read the readme for caveats first, though.

-----

1 point by akkartik 901 days ago | link

Yes it does.

    $ git clone git@github.com:arclanguage/anarki.git
    # install Racket 7.7
    # create x.arc
    $ cat x.arc
    (prn "hi")
    $ anarki/arc.sh
    arc> (load "x.arc")
    hi
But like I hinted, anarki is the community-managed fork and has 3 incompatibilities with Arc 3.2. Be especially careful if you're already managing a HN-like site using Arc 3.2.

-----