From 017451370f2623a48c0712d2f0c468f3efd87279 Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 17 Apr 2026 22:16:13 +0000 Subject: [PATCH] Fix letrec structure: wait-for-el as proper binding, not begin-wrapped The previous insert wrapped reload-frame and wait-for-el in a begin block instead of making them separate letrec bindings. This made reload-frame invisible to later bindings. Fixed by inserting wait-for-el at index 3 in the letrec bindings list. Co-Authored-By: Claude Opus 4.6 (1M context) --- sx/sx/applications/htmx/runner.sx | 43 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/sx/sx/applications/htmx/runner.sx b/sx/sx/applications/htmx/runner.sx index 3c8c4809..c0c8c8f4 100644 --- a/sx/sx/applications/htmx/runner.sx +++ b/sx/sx/applications/htmx/runner.sx @@ -24,29 +24,28 @@ "true")) true (do (hs-wait 200) (wait-boot)))))) - (begin - (reload-frame - (fn - () - (let - ((w (host-get (dom-query "#test-iframe") "contentWindow"))) - (host-call (host-get w "location") "reload") - (hs-wait 1000) - (wait-boot) - (hs-wait 500)))) - (wait-for-el - (fn - (sel max-tries) - (let - ((doc (get-doc)) - (el (when doc (host-call doc "querySelector" sel)))) + (reload-frame + (fn + () + (let + ((w (host-get (dom-query "#test-iframe") "contentWindow"))) + (host-call (host-get w "location") "reload") + (hs-wait 1000) + (wait-boot) + (hs-wait 500)))) + (wait-for-el + (fn + (sel max-tries) + (let + ((doc (get-doc)) + (el (when doc (host-call doc "querySelector" sel)))) + (if + el + el (if - el - el - (if - (<= max-tries 0) - nil - (do (hs-wait 200) (wait-for-el sel (- max-tries 1))))))))) + (<= max-tries 0) + nil + (do (hs-wait 200) (wait-for-el sel (- max-tries 1)))))))) (run-action (fn (action)