Arc Forumnew | comments | leaders | submitlogin
2 points by eds 6046 days ago | link | parent

Just redefine the function.

  arc> (defop hello req
         (pr "hello world")
         (defop hello req
           (pr "hello again")))
  #<procedure:gs1780>
  arc> (asv)
  ready to serve port 8080
When you load the page the first time, it will say "hello world", on subsequent times it'll say "hello again".


1 point by byrneseyeview 6046 days ago | link

After entering (asv), I don't have an arc prompt, and to get the prompt I have to quit (asv), which means that loading the '/hello' page gives an error. Can I get the arc prompt while (asv) is running?

-----

5 points by croach 6046 days ago | link

In order to get to the arc prompt, you'll need to run the application server (asv) in a separate thread, you can do so with the following code:

  (= app (thread (asv)))
and, you can stop the server with the this code:

  (break-thread app)
Once Arc's app server is running in a separate thread you'll have full access to the Arc repl and you'll then be able to modify your application on the fly.

-----