Arc Forumnew | comments | leaders | submitlogin
3 points by waterhouse 5127 days ago | link | parent

I use OS X. Consider me an expert on this subject; I'll answer any questions.

As aw says, don't use the "-m" option. Also, use the "-i" option, for "interactive"; without it, when you ctrl-C an Arc session, the whole process will abort, but with it, you'll get a MzScheme prompt, at which point you can use (tl) to return to Arc.

I also highly recommend that you install a tool called rlwrap. It does paren-matching and lets you use arrow keys (or ctrl-N, ctrl-P, ctrl-F, ctrl-B for down, up, right, left) to move around and access previous commands. Here's the command that I suggest you use to start Arc from the arc3.1 folder:

  rlwrap -c -r -l ~/Documents/ARC_LOG -q "\"" -C arc mzscheme -i -f as.scm
(You can strip off everything before the "mzscheme", but once you've tried it with and without rlwrap, you will want rlwrap.)

For extra credit, add the following to the file ~/.bash_profile:

  alias arc='cd [path-to-arc]/arc3.1; rlwrap -c -r -l ~/Documents/ARC_LOG -q "\"" -C arc mzscheme -i -f as.scm'
Then you can start Arc just by typing "arc".


2 points by elibarzilay 5126 days ago | link

Note that Racket has readline support: http://docs.racket-lang.org/readline/

-----

1 point by waterhouse 5126 days ago | link

Unfortunately, it doesn't do paren- or quote-matching, and it doesn't interact well with the current arc> prompt.

  $ racket -il readline -f as.scm
  Welcome to Racket v5.0.2.
  Use (quit) to quit, (tl) to return here after an interrupt.
  arc> 
  (+ 1 2)
  3
  arc> 
  "bad"
  "bad"
  arc> 
  (quit)
With access to the underlying Racket, one can (require readline/readline) and do (readline "arc> ") to get the proper prompt, but a) this requires redoing the Arc REPL, either by hacking (tl) in ac.scm or by writing something like (while t (prn:eval:read ($.readline "arc> "))), and b) it still doesn't do the matching, which I find an important feature.

-----

3 points by elibarzilay 5126 days ago | link

Not much to do about the prompt -- racket needs to know how wide the prompt which is why that argument is there.

But the paren matching is definitely possible -- I have "set blink-matching-paren on" in my ~/.inputrc file, and never had any problems with it.

BTW, another advantage of using the racket readline facility is that it's possible to do completion for the toplevel namespace.

-----