HS: do→let/it chaining, single-IO fetch, fetch URL parser, IO mock
Compiler: do-blocks now compile to (let ((it cmd1)) (let ((it cmd2)) ...)) instead of (do cmd1 cmd2 ...). This chains the `it` variable through command sequences, enabling `fetch X then put it into me` pattern. Each command's result is bound to `it` for the next command. Runtime: hs-fetch simplified to single perform (io-fetch url format) instead of two-stage io-fetch + io-parse-text/json. Parser: fetch URL /path handled by reading /+ident tokens. Default fetch format changed to "text" (was "json"). Test runner: mock fetch routes with format-specific responses. io-fetch handler returns content directly based on format param. Fetch tests still need IO suspension to chain through let continuations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1270,7 +1270,7 @@
|
||||
(let
|
||||
((url (if (nil? url-atom) url-atom (parse-arith (parse-poss url-atom)))))
|
||||
(let
|
||||
((fmt (if (match-kw "as") (let ((f (tp-val))) (adv!) f) "json")))
|
||||
((fmt (if (match-kw "as") (let ((f (tp-val))) (adv!) f) "text")))
|
||||
(list (quote fetch) url fmt)))))))
|
||||
(define
|
||||
parse-call-args
|
||||
|
||||
Reference in New Issue
Block a user