HS: targeted IO let/it chaining — fetch tests 0→4/23

Compiler: do-blocks containing IO commands (hs-fetch, hs-wait, perform)
are compiled as (let ((it cmd1)) (let ((it cmd2)) ...)) to chain the
it variable through IO suspensions. Non-IO do-blocks stay as plain
(do cmd1 cmd2). This enables fetch X then put it into me pattern.

Parser: then-separator handled via __then__ markers (stripped in output).
fetch URL /path parsing. Default format "text".

Runtime: hs-fetch simplified to single perform (io-fetch url format).

Test runner: mock fetch routes with format-specific responses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 23:13:49 +00:00
parent 84996d74e2
commit f85004c8a2
2 changed files with 31 additions and 3 deletions

View File

@@ -1859,7 +1859,8 @@
(let
((acc2 (append acc (list cmd))))
(cond
((match-kw "then") (cl-collect acc2))
((match-kw "then")
(cl-collect (append acc2 (list (quote __then__)))))
((and (not (at-end?)) (= (tp-type) "keyword") (cmd-kw? (tp-val)))
(cl-collect acc2))
(true acc2)))))))
@@ -1868,7 +1869,10 @@
(cond
((= (len cmds) 0) nil)
((= (len cmds) 1) (first cmds))
(true (cons (quote do) cmds))))))
(true
(cons
(quote do)
(filter (fn (c) (not (= c (quote __then__)))) cmds)))))))
(define
parse-on-feat
(fn