Arc Forumnew | comments | leaders | submitlogin
2 points by shader 5647 days ago | link | parent

Here's what I would do:

Modify as.scm, or make a new scheme file that contains this code, slightly modified from Anarki's as.scm:

  ;load arc files
  (require mzscheme)
  (require "ac.scm")
  (require "brackets.scm")
  (use-bracket-readtable)

  ;compile arc.arc
  (if (and (file-exists? "arc.arc.scm") (< (file-or-directory-modify-seconds "arc.arc")
                                           (file-or-directory-modify-seconds "arc.arc.scm")))
      (load "arc.arc.scm")
      (begin
        (display "Compiling arc.arc...\n")
        (flush-output (current-output-port))
        (acompile "arc.arc")))
  (aload "libs.arc")
  
  ;either load a file or run the prompt
  (if (> (vector-length argv) 0)
      (begin
        (call-with-input-file
  	  (vector-ref argv 0)
  	aload1)
        (exit))
      (tl))
Then, if you're using powershell, you can create a function to save you some typing:

  function arc { mzscheme -fmv as.scm $args }
You may want to put this in you powershell profile:

  notepad $profile
Otherwise the function will only last as long as your powershell session.

When you're ready to use it, type either "arc" to just get the repl, or "arc file.arc" to execute the file. It's that easy!