Arc Forumnew | comments | leaders | submitlogin
Modify page without restarting (asv)?
3 points by byrneseyeview 6046 days ago | 4 comments
How do I edit a function while the server is running? e.g. as in the tutorial, if I do (defop hello req (pr "hello world")) and then view it, is it possible to edit the function 'hello' without quitting 'asv', and if so, how is this done?


2 points by eds 6045 days ago | link

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 6045 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 6045 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.

-----

-4 points by lihong 6043 days ago | link

we as a leading ttp://www.pvpsale.co company. pvpsale.com is an Expert Online ttp://www.pvpsale.co ttp://www.pvpsale.co Site, dedicated in providing customers with fun in the professional service of ttp://www.pvpsale.com/World-of-Warcraft-US-Powerleveling.as. Excellent Service, Super wow power leveling. plc feel free contact us,thanks you. we also supply ttp://www.pvpsale.com/Maple-Story-MM.as and supply ttp://www.pvpsale.com/Maple-Story-EU.as pls check the new ttp://www.pvpsale.com/World-of-Warcraft-US-Gold.as and buy ttp://www.pvpsale.com/World-of-Warcraft-US-Gold.as on our website.

-----