Convert code for "Dice of Doom" from Barski's "Land of Lisp" to use Hunchentoot web server.
Convert code for “Dice of Doom” from “Land of Lisp” to use Hunchentoot web server for version 3 and 4.
I recently went through “Land of Lisp” by Conrad Barski, a thoroughly enjoyable book! Unfortunately, I couldn’t get the web server
in the book working, even when I tried the code from the website (to make sure I didn’t fat finger something). I had previously
gone through “Lisp for the Web” by Adam Tornhill, where he used Hunchentoot, and the callback
handlers seemed similar enough, so I went ahead and converted it.
A few notes:
cl-hunchentoot
package.*standard-output*
stream as in the original, but because HunchentootContent-type
or HTTP/1.1
header (which was missing in the original “Dice of Doom” code). This includes path and parameter parsing, sochosen
becomes a string if it’s not nil
.dabbrev-expand
religiously, so I see no reason to shorten names.The relevant change is here.
Beware! I am learning, so there may still be issues with this code. I also have to apologize for the sloppiness of the repository history.
I wasn’t planning on releasing this publicly and it was mainly as a safety net and I was focused on learning the language, not Git. I swear
my shared repositories don’t usually look this bad!