From db8e680cafeaa1ebb05f2a99b49d3fbf0829a9e8 Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 17 Apr 2026 23:01:23 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20do=E2=86=92let/it=20chaining=20(caused?= =?UTF-8?q?=2080-test=20regression)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The let/it wrapping changed semantics of ALL multi-command sequences, breaking independent side-effect chains like (do (add-class) (add-class)). Need a targeted approach — chain it only for then-separated commands. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/hyperscript/compiler.sx | 18 +----------------- shared/static/wasm/sx/hs-compiler.sx | 18 +----------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/lib/hyperscript/compiler.sx b/lib/hyperscript/compiler.sx index 912ac999..6a47db8e 100644 --- a/lib/hyperscript/compiler.sx +++ b/lib/hyperscript/compiler.sx @@ -999,23 +999,7 @@ (hs-to-sx (nth ast 1)) (hs-to-sx (nth ast 2))))) ((= head (quote do)) - (let - ((compiled (map hs-to-sx (rest ast)))) - (if - (= (len compiled) 1) - (first compiled) - (let - ((last-cmd (nth compiled (- (len compiled) 1))) - (init-cmds (reverse (rest (reverse compiled))))) - (reduce - (fn - (body cmd) - (list - (quote let) - (list (list (quote it) cmd)) - body)) - last-cmd - (reverse init-cmds)))))) + (cons (quote do) (map hs-to-sx (rest ast)))) ((= head (quote wait)) (list (quote hs-wait) (nth ast 1))) ((= head (quote wait-for)) (emit-wait-for ast)) ((= head (quote log)) diff --git a/shared/static/wasm/sx/hs-compiler.sx b/shared/static/wasm/sx/hs-compiler.sx index 912ac999..6a47db8e 100644 --- a/shared/static/wasm/sx/hs-compiler.sx +++ b/shared/static/wasm/sx/hs-compiler.sx @@ -999,23 +999,7 @@ (hs-to-sx (nth ast 1)) (hs-to-sx (nth ast 2))))) ((= head (quote do)) - (let - ((compiled (map hs-to-sx (rest ast)))) - (if - (= (len compiled) 1) - (first compiled) - (let - ((last-cmd (nth compiled (- (len compiled) 1))) - (init-cmds (reverse (rest (reverse compiled))))) - (reduce - (fn - (body cmd) - (list - (quote let) - (list (list (quote it) cmd)) - body)) - last-cmd - (reverse init-cmds)))))) + (cons (quote do) (map hs-to-sx (rest ast)))) ((= head (quote wait)) (list (quote hs-wait) (nth ast 1))) ((= head (quote wait-for)) (emit-wait-for ast)) ((= head (quote log))