Discussion:
[Chicken-users] Working with Spiffy incrementally
Jack Lucas
7 years ago
Permalink
Is anyone aware of a method where I can work with spiffy incrementally?

Current workflow as I see it would look like editing the source and then running csi -s script.scm.

It'd be very nice if I could (start-server) in a repl in emacs and be able to re-evaluate vhost-map and any functions mapped in vhost-map. I tried doing this but when I refreshed the page in my browser it didn't seem like it updated to the new evaluation.
Peter Bex
7 years ago
Permalink
Post by Jack Lucas
Is anyone aware of a method where I can work with spiffy incrementally?
Current workflow as I see it would look like editing the source and then running csi -s script.scm.
It'd be very nice if I could (start-server) in a repl in emacs and be able to re-evaluate vhost-map and any functions mapped in vhost-map. I tried doing this but when I refreshed the page in my browser it didn't seem like it updated to the new evaluation.
Hi!

vhost-map is a parameter, which is thread-local, so if you modify it in
the repl, that's not going to affect the thread running the server.

I presume you're not going to change the vhost entries all that much,
so perhaps an extra layer of indirection would solve the problem:

(vhost-map `(("localhost" . ,(lambda (c) (my-proc c)))))

Then you should be able to redefine my-proc, and the lambda in the vhost
should pick it up.

HTH,
Peter
Kristian Lein-Mathisen
7 years ago
Permalink
Hi Lucas,

I try to explore this in my screencast:


Perhaps that can help you out.
K.
...
Jack Lucas
7 years ago
Permalink
Thank you! That video was exactly what I was looking for.

Jack
...