Discussion:
[Chicken-users] Working with Spiffy incrementally
Jack Lucas
2017-11-09 23:00:14 UTC
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
2017-11-10 07:38:43 UTC
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
2017-11-10 12:07:51 UTC
Permalink
Hi Lucas,

I try to explore this in my screencast:


Perhaps that can help you out.
K.
Post by Jack Lucas
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.
Post by Jack Lucas
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,
(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
Jack Lucas
2017-11-10 18:48:24 UTC
Permalink
Thank you! That video was exactly what I was looking for.

Jack
-------- Original Message --------
Subject: Re: [Chicken-users] Working with Spiffy incrementally
Local Time: November 10, 2017 7:07 AM
UTC Time: November 10, 2017 12:07 PM
Hi Lucas,
http://youtu.be/eXB3I3S3vJc
Perhaps that can help you out.
K.
Post by Peter Bex
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,
(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
Loading...