clog-web: how to reload content? #80
-
Hello there! I am trying the 24th tutorial about clog-web. I run Is it normal behavior? It would be great to not have to re-run start-tutorial everytime. (Would this be a Clack limitation? (I read a similar complain for Caveman. When I use Hunchentoot I can re-complie a route definition, refresh the page and see the changes, without the need to restart the server).) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I would like to know the answer to this as well. However, because I am learning lisp by using clog, what I have started to do is to run (clog-repl) and re-create the tutorials in the repl. The benefit of this is that you see the updates immediately and it forces you to chop up the tutorial forms into bits and pieces and try permutations until you can see how everything works. I am immensely grateful that the author of this framework wrote a bunch of tutorials. The manual is incredibly useful as well. Hopefully we can figure out how the live coding workflow needs to operate for real projects. |
Beta Was this translation helpful? Give feedback.
-
When you recompile the on-new-window handler you need to set it again with set-on-new-window as the path is still pointing to the old compiled code. (set-on-new-window #'on-new-window) Alternatively you can use (set-on-new-window 'on-new-window) ie using the symbol instead of the function symbol and you no longer have to set each time the handler can do that also in INITIALIZE. Another alternative is to not place the code to write the page in your on-new-window-handler but have the on-new-window-handler call another function and recompile that function instead. |
Beta Was this translation helpful? Give feedback.
When you recompile the on-new-window handler you need to set it again with set-on-new-window as the path is still pointing to the old compiled code. (set-on-new-window #'on-new-window)
Alternatively you can use (set-on-new-window 'on-new-window) ie using the symbol instead of the function symbol and you no longer have to set each time the handler can do that also in INITIALIZE.
Another alternative is to not place the code to write the page in your on-new-window-handler but have the on-new-window-handler call another function and recompile that function instead.