drafts, hunchentoot-vib: Complete draft
authorLucian Mogosanu <lucian@mogosanu.ro>
Tue, 27 Aug 2019 15:35:09 +0000 (18:35 +0300)
committerLucian Mogosanu <lucian@mogosanu.ro>
Tue, 27 Aug 2019 15:35:09 +0000 (18:35 +0300)
drafts/000-hunchentoot-vib.markdown

index cd5677e..ee2ca67 100644 (file)
@@ -233,27 +233,71 @@ Since we've fortunately exhausted request.lisp, we're left with:
 **[[]]** [**reply**][ht-c-rep]: The "response" counterpart to request
 objects; holds the response [content-type][ht-ct-slot],
 [length][ht-cl-slot], [headers][ht-ho-slot], [return
-code][ht-rc-slot], [encoding][ht-ef-slot] and [cookies][ht-co-slot].
+code][ht-rc-slot], [encoding][ht-ef-slot] and
+[cookies][ht-co-slot]. Implemented methods:
 
 <a name="ii3" href="#ii3">[ii3]</a> [**initialize-instance**][ht-ii3]:
+":after" the reply object is instantiated, set content-type header to
+the \*default-content-type\*.
 
-<a name="hos" href="#hos">[hos]</a> [**headers-out\***][ht-hos]:
+The following are, similarly to the request accessor functions,
+wrappers which implicitly bind their reply argument to the \*reply\*
+special. Also, most of them also come with a setf definition, which
+simply set the associated slot of the reply argument (also bound to
+\*reply\* unless specified) to a given new-value. I shan't bother to
+give details where there are none, here they are:
+
+<a name="hos" href="#hos">[hos]</a> [**headers-out\***][ht-hos]
 
 <a name="cos" href="#cos">[cos]</a> [**cookies-out\***][ht-cos]:
+[setf-er][ht-cos-setf].
 
 <a name="cts" href="#cts">[cts]</a> [**content-type\***][ht-cts]:
+[setf-er][ht-cts-setf].
 
 <a name="cls" href="#cls">[cls]</a> [**content-length\***][ht-cls]:
+[setf-er][ht-cls-setf].
 
 <a name="rcs" href="#rcs">[rcs]</a> [**return-code\***][ht-rcs]:
-
-<a name="refs" href="#refs">[refs]</a> [**reply-external-format\***][ht-refs]:
-
-<a name="hosp" href="#hosp">[hosp]</a> [**header-out-set-p**][ht-hosp]:
-
-<a name="ho" href="#ho">[ho]</a> [**header-out**][ht-ho]:
-
-<a name="co" href="#co">[co]</a> [**cookie-out**][ht-co]:
+[setf-er][ht-rcs-setf].
+
+<a name="refs"
+href="#refs">[refs]</a> [**reply-external-format\***][ht-refs]:
+[setf-er][ht-refs-setf].
+
+<a name="hosp"
+href="#hosp">[hosp]</a> [**header-out-set-p**][ht-hosp]: Looks up an
+output [header][ht-ho-slot] and returns true if found.
+
+<a name="ho" href="#ho">[ho]</a> [**header-out**][ht-ho]: Looks up a(n
+output) [header][ht-ho-slot] and, if found, returns its value. Unlike
+[the previous](#hosp) function, this one also comes with a
+[setf-er][ht-ho-setf] which e.g. performs conversions if the name
+provided is a string etc. and checks the types of content-type and
+content-length headers.
+
+<a name="co" href="#co">[co]</a> [**cookie-out**][ht-co]: Looks up a
+cookie in the respective [alist][ht-co-slot] and returns its value if
+found.
+
+This is it, then: a complete review of all the [core][hunchentoot-iii]
+architectural components of Hunchentoot. Remember, this program
+actually works, and not by mere happenstance, but quite deliberately,
+as the result of what I expect was hard work to bake this tangled
+shawarma. Note that I don't plan to add *any* functionality to the
+current mess, at least not until completely rewriting it, preferably
+on top of a not-completely-fucked [WWW stack][logs-mp-on-lisp-www]. If
+you want to make a Lisp logger/blog/web front-end using current-day
+WWW, then it seems unfortunately that this is the best you got.
+
+Having said that, the next episode in the Hunchentoot saga will reveal
+two items: a genesis of the Hunchentoot that was reviewed here, and
+one of Hunchentoot plus [all its dependencies][hunchentoot-deps], for
+which I can only vouch by noting that they sorta work, not that they
+do precisely what's written on the label. Then I can start building
+around this: a comment mechanism for this blog, an IRC logger, a
+pastebin and all those other fundamental webthings that keep things
+running.
 
 [^1]: Special variables have a [special meaning][cltl-special] in
     Common Lisp -- see what I did there? Namely, a special variable
@@ -380,3 +424,6 @@ code][ht-rc-slot], [encoding][ht-ef-slot] and [cookies][ht-co-slot].
 [usocket-wmc]: https://quickref.common-lisp.net/usocket.html#go-to-the-USOCKET_003ccolon_003e_003ccolon_003eWITH_002dMAPPED_002dCONDITIONS-macro
 [clhs-catch]: http://www.lispworks.com/documentation/HyperSpec/Body/s_catch.htm
 [clhs-unwind-protect]: http://www.lispworks.com/documentation/HyperSpec/Body/s_unwind.htm
+[hunchentoot-iii]: /posts/y06/097-hunchentoot-iii.html
+[logs-mp-on-lisp-www]: http://logs.nosuchlabs.com/log/trilema/2019-08-01#1926066
+[hunchentoot-deps]: /posts/y06/097-hunchentoot-iii.html#fn3