freenode/#lisp - IRC Chatlog
Search
20:01:06
Ober
no-defun-allowed: yeah probably user issue on my part. restarting slime seems to not hang now.
21:04:02
semz
Question about iterate: A (for VAR initially ... then ...) clause can't use PVAR from a (for PVAR previous VAR) clause in the THEN part because the clauses expand to (PROGN (SETQ PVAR VAR) (SETQ VAR ...)). Is this an undocumented gotcha or does it follow from some principle I have missed and I should have expected it?
0:22:12
aeth
Oh wow, that was involved. It took quite a bit to get variable support in my HTML macro. https://gitlab.com/mbabich/cl-documents/blob/ab3551f26a4bcfd1ec47532efccc45693cc247b2/generate-html.lisp#L9-47
0:22:27
aeth
I have to manually iterate the lists so it terminates one after the list end instead of at the list end.
0:25:01
aeth
Basically I assume that (code-char 0) is invalid, so when I come across a symbol that's not a keyword (i.e. a variable) then I write (code-char 0) and I push the variable-name to an internal list in write-html, which is returned at the end (in reverse order). Then I write the string, split on (code-char 0)s with calls to (write-html ,variable ...) in between the splits.