diff --git a/lib/hyperscript/compiler.sx b/lib/hyperscript/compiler.sx index 9c895d9a..8bde5960 100644 --- a/lib/hyperscript/compiler.sx +++ b/lib/hyperscript/compiler.sx @@ -751,10 +751,21 @@ (list (quote hs-last) (hs-to-sx (nth ast 2)) (nth ast 1)) (list (quote hs-query-last) (nth ast 1)))) ((= head (quote add-class)) - (list - (quote dom-add-class) - (hs-to-sx (nth ast 2)) - (nth ast 1))) + (let + ((raw-tgt (nth ast 2))) + (if + (and (list? raw-tgt) (= (first raw-tgt) (quote query))) + (list + (quote for-each) + (list + (quote fn) + (list (quote _el)) + (list (quote dom-add-class) (quote _el) (nth ast 1))) + (list (quote hs-query-all) (nth raw-tgt 1))) + (list + (quote dom-add-class) + (hs-to-sx raw-tgt) + (nth ast 1))))) ((= head (quote multi-add-class)) (let ((target (hs-to-sx (nth ast 1))) @@ -774,10 +785,24 @@ (fn (cls) (list (quote dom-remove-class) target cls)) classes)))) ((= head (quote remove-class)) - (list - (quote dom-remove-class) - (hs-to-sx (nth ast 2)) - (nth ast 1))) + (let + ((raw-tgt (nth ast 2))) + (if + (and (list? raw-tgt) (= (first raw-tgt) (quote query))) + (list + (quote for-each) + (list + (quote fn) + (list (quote _el)) + (list + (quote dom-remove-class) + (quote _el) + (nth ast 1))) + (list (quote hs-query-all) (nth raw-tgt 1))) + (list + (quote dom-remove-class) + (hs-to-sx raw-tgt) + (nth ast 1))))) ((= head (quote toggle-class)) (list (quote hs-toggle-class!) diff --git a/lib/hyperscript/runtime.sx b/lib/hyperscript/runtime.sx index 334de332..bca2bfd7 100644 --- a/lib/hyperscript/runtime.sx +++ b/lib/hyperscript/runtime.sx @@ -13,45 +13,53 @@ ;; Register an event listener. Returns unlisten function. ;; (hs-on target event-name handler) → unlisten-fn (define - hs-on - (fn (target event-name handler) (dom-listen target event-name handler))) + hs-each + (fn + (target action) + (if (list? target) (for-each action target) (action target)))) ;; Register for every occurrence (no queuing — each fires independently). ;; Stock hyperscript queues by default; "every" disables queuing. (define - hs-on-every + hs-on (fn (target event-name handler) (dom-listen target event-name handler))) ;; Run an initializer function immediately. ;; (hs-init thunk) — called at element boot time -(define hs-init (fn (thunk) (thunk))) +(define + hs-on-every + (fn (target event-name handler) (dom-listen target event-name handler))) ;; ── Async / timing ────────────────────────────────────────────── ;; Wait for a duration in milliseconds. ;; In hyperscript, wait is async-transparent — execution pauses. ;; Here we use perform/IO suspension for true pause semantics. -(define hs-wait (fn (ms) (perform (list (quote io-sleep) ms)))) +(define hs-init (fn (thunk) (thunk))) ;; Wait for a DOM event on a target. ;; (hs-wait-for target event-name) — suspends until event fires +(define hs-wait (fn (ms) (perform (list (quote io-sleep) ms)))) + +;; Wait for CSS transitions/animations to settle on an element. (define hs-wait-for (fn (target event-name) (perform (list (quote io-wait-event) target event-name)))) -;; Wait for CSS transitions/animations to settle on an element. -(define hs-settle (fn (target) (perform (list (quote io-settle) target)))) - ;; ── Class manipulation ────────────────────────────────────────── ;; Toggle a single class on an element. +(define hs-settle (fn (target) (perform (list (quote io-settle) target)))) + +;; Toggle between two classes — exactly one is active at a time. (define hs-toggle-class! (fn (target cls) (host-call (host-get target "classList") "toggle" cls))) -;; Toggle between two classes — exactly one is active at a time. +;; Take a class from siblings — add to target, remove from others. +;; (hs-take! target cls) — like radio button class behavior (define hs-toggle-between! (fn @@ -61,8 +69,10 @@ (do (dom-remove-class target cls1) (dom-add-class target cls2)) (do (dom-remove-class target cls2) (dom-add-class target cls1))))) -;; Take a class from siblings — add to target, remove from others. -;; (hs-take! target cls) — like radio button class behavior +;; ── DOM insertion ─────────────────────────────────────────────── + +;; Put content at a position relative to a target. +;; pos: "into" | "before" | "after" (define hs-toggle-style! (fn @@ -86,10 +96,9 @@ (dom-set-style target prop "hidden") (dom-set-style target prop ""))))))) -;; ── DOM insertion ─────────────────────────────────────────────── +;; ── Navigation / traversal ────────────────────────────────────── -;; Put content at a position relative to a target. -;; pos: "into" | "before" | "after" +;; Navigate to a URL. (define hs-take! (fn @@ -105,9 +114,7 @@ (for-each (fn (el) (dom-remove-attr el name)) els) (dom-set-attr target name "true")))))) -;; ── Navigation / traversal ────────────────────────────────────── - -;; Navigate to a URL. +;; Find next sibling matching a selector (or any sibling). (define hs-put! (fn @@ -120,10 +127,10 @@ ((= pos "start") (dom-insert-adjacent-html target "afterbegin" value)) ((= pos "end") (dom-insert-adjacent-html target "beforeend" value))))) -;; Find next sibling matching a selector (or any sibling). +;; Find previous sibling matching a selector. (define hs-navigate! (fn (url) (perform (list (quote io-navigate) url)))) -;; Find previous sibling matching a selector. +;; First element matching selector within a scope. (define hs-scroll! (fn @@ -136,7 +143,7 @@ ((= position "bottom") (dict :block "end")) (true (dict :block "start"))))))) -;; First element matching selector within a scope. +;; Last element matching selector. (define hs-halt! (fn @@ -146,12 +153,14 @@ (host-call event "preventDefault" (list)) (when (= mode "event") (host-call event "stopPropagation" (list)))))) -;; Last element matching selector. +;; First/last within a specific scope. (define hs-select! (fn (target) (host-call target "select" (list)))) -;; First/last within a specific scope. (define hs-reset! (fn (target) (host-call target "reset" (list)))) +;; ── Iteration ─────────────────────────────────────────────────── + +;; Repeat a thunk N times. (define hs-next (fn @@ -171,9 +180,7 @@ (true (find-next (dom-next-sibling el)))))) (find-next sibling))))) -;; ── Iteration ─────────────────────────────────────────────────── - -;; Repeat a thunk N times. +;; Repeat forever (until break — relies on exception/continuation). (define hs-previous (fn @@ -193,27 +200,24 @@ (true (find-prev (dom-get-prop el "previousElementSibling")))))) (find-prev sibling))))) -;; Repeat forever (until break — relies on exception/continuation). -(define - hs-query-all - (fn - (sel) - (dom-query-all - (host-call (host-global "document") "querySelector" (list "body")) - sel))) - ;; ── Fetch ─────────────────────────────────────────────────────── ;; Fetch a URL, parse response according to format. ;; (hs-fetch url format) — format is "json" | "text" | "html" -(define - hs-query-first - (fn (sel) (host-call (host-global "document") "querySelector" sel))) +(define hs-query-all (fn (sel) (dom-query-all (dom-body) sel))) ;; ── Type coercion ─────────────────────────────────────────────── ;; Coerce a value to a type by name. ;; (hs-coerce value type-name) — type-name is "Int", "Float", "String", etc. +(define + hs-query-first + (fn (sel) (host-call (host-global "document") "querySelector" sel))) + +;; ── Object creation ───────────────────────────────────────────── + +;; Make a new object of a given type. +;; (hs-make type-name) — creates empty object/collection (define hs-query-last (fn @@ -222,17 +226,17 @@ ((all (dom-query-all (dom-body) sel))) (if (> (len all) 0) (nth all (- (len all) 1)) nil)))) -;; ── Object creation ───────────────────────────────────────────── - -;; Make a new object of a given type. -;; (hs-make type-name) — creates empty object/collection -(define hs-first (fn (scope sel) (dom-query-all scope sel))) - ;; ── Behavior installation ─────────────────────────────────────── ;; Install a behavior on an element. ;; A behavior is a function that takes (me ...params) and sets up features. ;; (hs-install behavior-fn me ...args) +(define hs-first (fn (scope sel) (dom-query-all scope sel))) + +;; ── Measurement ───────────────────────────────────────────────── + +;; Measure an element's bounding rect, store as local variables. +;; Returns a dict with x, y, width, height, top, left, right, bottom. (define hs-last (fn @@ -241,10 +245,10 @@ ((all (dom-query-all scope sel))) (if (> (len all) 0) (nth all (- (len all) 1)) nil)))) -;; ── Measurement ───────────────────────────────────────────────── +;; ── Transition ────────────────────────────────────────────────── -;; Measure an element's bounding rect, store as local variables. -;; Returns a dict with x, y, width, height, top, left, right, bottom. +;; Transition a CSS property to a value, optionally with duration. +;; (hs-transition target prop value duration) (define hs-repeat-times (fn @@ -254,10 +258,6 @@ (fn (i) (when (< i n) (do (thunk) (do-repeat (+ i 1)))))) (do-repeat 0))) -;; ── Transition ────────────────────────────────────────────────── - -;; Transition a CSS property to a value, optionally with duration. -;; (hs-transition target prop value duration) (define hs-repeat-forever (fn @@ -365,14 +365,14 @@ (value type-name) (if (nil? value) false (hs-type-check value type-name)))) + + + + (define hs-strict-eq (fn (a b) (and (= (type-of a) (type-of b)) (= a b)))) - - - - (define hs-falsy? (fn @@ -384,7 +384,8 @@ ((and (list? v) (= (len v) 0)) true) ((= v 0) true) (true false)))) - +;; ── Sandbox/test runtime additions ────────────────────────────── +;; Property access — dot notation and .length (define hs-matches? (fn @@ -393,8 +394,7 @@ (string? target) (if (= pattern ".*") true (string-contains? target pattern)) false))) -;; ── Sandbox/test runtime additions ────────────────────────────── -;; Property access — dot notation and .length +;; DOM query stub — sandbox returns empty list (define hs-contains? (fn @@ -414,7 +414,7 @@ true (hs-contains? (rest collection) item))))) (true false)))) -;; DOM query stub — sandbox returns empty list +;; Method dispatch — obj.method(args) (define hs-empty? (fn @@ -425,13 +425,13 @@ ((list? v) (= (len v) 0)) ((dict? v) (= (len (keys v)) 0)) (true false)))) -;; Method dispatch — obj.method(args) -(define hs-first (fn (lst) (first lst))) ;; ── 0.9.90 features ───────────────────────────────────────────── ;; beep! — debug logging, returns value unchanged -(define hs-last (fn (lst) (last lst))) +(define hs-first (fn (lst) (first lst))) ;; Property-based is — check obj.key truthiness +(define hs-last (fn (lst) (last lst))) +;; Array slicing (inclusive both ends) (define hs-template (fn @@ -517,7 +517,7 @@ (set! i (+ i 1)) (tpl-loop))))))) (do (tpl-loop) result)))) -;; Array slicing (inclusive both ends) +;; Collection: sorted by (define hs-make-object (fn @@ -529,7 +529,7 @@ (fn (pair) (dict-set! d (first pair) (nth pair 1))) pairs) d)))) -;; Collection: sorted by +;; Collection: sorted by descending (define hs-method-call (fn @@ -552,11 +552,11 @@ (if (= (first lst) item) i (idx-loop (rest lst) (+ i 1)))))) (idx-loop obj 0))) (true nil)))) -;; Collection: sorted by descending -(define hs-beep (fn (v) v)) ;; Collection: split by -(define hs-prop-is (fn (obj key) (not (hs-falsy? (host-get obj key))))) +(define hs-beep (fn (v) v)) ;; Collection: joined by +(define hs-prop-is (fn (obj key) (not (hs-falsy? (host-get obj key))))) + (define hs-slice (fn diff --git a/shared/static/wasm/sx/hs-compiler.sx b/shared/static/wasm/sx/hs-compiler.sx index 9c895d9a..8bde5960 100644 --- a/shared/static/wasm/sx/hs-compiler.sx +++ b/shared/static/wasm/sx/hs-compiler.sx @@ -751,10 +751,21 @@ (list (quote hs-last) (hs-to-sx (nth ast 2)) (nth ast 1)) (list (quote hs-query-last) (nth ast 1)))) ((= head (quote add-class)) - (list - (quote dom-add-class) - (hs-to-sx (nth ast 2)) - (nth ast 1))) + (let + ((raw-tgt (nth ast 2))) + (if + (and (list? raw-tgt) (= (first raw-tgt) (quote query))) + (list + (quote for-each) + (list + (quote fn) + (list (quote _el)) + (list (quote dom-add-class) (quote _el) (nth ast 1))) + (list (quote hs-query-all) (nth raw-tgt 1))) + (list + (quote dom-add-class) + (hs-to-sx raw-tgt) + (nth ast 1))))) ((= head (quote multi-add-class)) (let ((target (hs-to-sx (nth ast 1))) @@ -774,10 +785,24 @@ (fn (cls) (list (quote dom-remove-class) target cls)) classes)))) ((= head (quote remove-class)) - (list - (quote dom-remove-class) - (hs-to-sx (nth ast 2)) - (nth ast 1))) + (let + ((raw-tgt (nth ast 2))) + (if + (and (list? raw-tgt) (= (first raw-tgt) (quote query))) + (list + (quote for-each) + (list + (quote fn) + (list (quote _el)) + (list + (quote dom-remove-class) + (quote _el) + (nth ast 1))) + (list (quote hs-query-all) (nth raw-tgt 1))) + (list + (quote dom-remove-class) + (hs-to-sx raw-tgt) + (nth ast 1))))) ((= head (quote toggle-class)) (list (quote hs-toggle-class!) diff --git a/shared/static/wasm/sx/hs-compiler.sxbc b/shared/static/wasm/sx/hs-compiler.sxbc index 46ce3949..a3100fc9 100644 --- a/shared/static/wasm/sx/hs-compiler.sxbc +++ b/shared/static/wasm/sx/hs-compiler.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "02755641080b27de" +(sxbc 1 "4c66a260636aad86" (code - :constants ("hs-to-sx" "make-symbol" "." "%" {:upvalue-count 0 :arity 1 :constants ("hs-to-sx") :bytecode (20 0 0 16 0 49 1 50)} {:upvalue-count 1 :arity 2 :constants ("not" "list?" "list" set! "first" "=" dom-set-prop "hs-to-sx" "nth" 1 2 attr dom-set-attr style dom-set-style ref "make-symbol" local me dom-set-inner-html it query) :bytecode (16 0 52 1 0 1 52 0 0 1 33 14 0 1 3 0 16 0 16 1 52 2 0 3 32 67 1 16 0 52 4 0 1 17 2 16 2 18 0 52 5 0 2 33 35 0 1 6 0 20 7 0 16 0 1 9 0 52 8 0 2 48 1 16 0 1 10 0 52 8 0 2 16 1 52 2 0 4 32 13 1 16 2 1 11 0 52 5 0 2 33 35 0 1 12 0 20 7 0 16 0 1 10 0 52 8 0 2 48 1 16 0 1 9 0 52 8 0 2 16 1 52 2 0 4 32 222 0 16 2 1 13 0 52 5 0 2 33 35 0 1 14 0 20 7 0 16 0 1 10 0 52 8 0 2 48 1 16 0 1 9 0 52 8 0 2 16 1 52 2 0 4 32 175 0 16 2 1 15 0 52 5 0 2 33 25 0 1 3 0 16 0 1 9 0 52 8 0 2 52 16 0 1 16 1 52 2 0 3 32 138 0 16 2 1 17 0 52 5 0 2 33 25 0 1 3 0 16 0 1 9 0 52 8 0 2 52 16 0 1 16 1 52 2 0 3 32 101 0 16 2 1 18 0 52 5 0 2 33 15 0 1 19 0 1 18 0 16 1 52 2 0 3 32 74 0 16 2 1 20 0 52 5 0 2 33 15 0 1 3 0 1 20 0 16 1 52 2 0 3 32 47 0 16 2 1 21 0 52 5 0 2 33 19 0 1 19 0 20 7 0 16 0 48 1 16 1 52 2 0 3 32 16 0 1 3 0 20 7 0 16 0 48 1 16 1 52 2 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("rest" "first" {:upvalue-count 2 :arity 6 :constants ("<=" "len" 1 ">" 0 "first" "hs-to-sx" me "make-symbol" "nth" "list" do guard fn event hs-on-every hs-on "=" "from" "rest" "filter" "every" "catch" "finally") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 242 0 16 0 52 1 0 1 1 4 0 52 3 0 2 33 9 0 16 0 52 5 0 1 32 1 0 2 17 6 16 1 33 10 0 20 6 0 16 1 48 1 32 3 0 1 7 0 17 7 20 6 0 16 6 48 1 17 8 16 4 33 97 0 16 4 52 5 0 1 52 8 0 1 17 9 20 6 0 16 4 1 2 0 52 9 0 2 48 1 17 10 16 5 33 39 0 1 11 0 1 12 0 16 9 3 16 10 52 10 0 2 52 10 0 2 16 8 52 10 0 3 20 6 0 16 5 48 1 52 10 0 3 32 22 0 1 12 0 16 9 3 16 10 52 10 0 2 52 10 0 2 16 8 52 10 0 3 32 26 0 16 5 33 19 0 1 11 0 16 8 20 6 0 16 5 48 1 52 10 0 3 32 2 0 16 8 17 9 1 13 0 1 14 0 52 10 0 1 16 9 52 10 0 3 17 10 16 3 33 16 0 1 15 0 16 7 18 0 16 10 52 10 0 4 32 13 0 1 16 0 16 7 18 0 16 10 52 10 0 4 32 6 1 16 0 52 5 0 1 1 18 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 0 1 2 0 52 9 0 2 16 2 16 3 16 4 16 5 49 6 32 212 0 16 0 52 5 0 1 1 20 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 0 1 2 0 52 9 0 2 16 3 16 4 16 5 49 6 32 162 0 16 0 52 5 0 1 1 21 0 52 17 0 2 33 26 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 2 3 16 4 16 5 49 6 32 120 0 16 0 52 5 0 1 1 22 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 2 16 3 16 0 1 2 0 52 9 0 2 16 5 49 6 32 70 0 16 0 52 5 0 1 1 23 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 2 16 3 16 4 16 0 1 2 0 52 9 0 2 49 6 32 20 0 18 1 16 0 52 19 0 1 16 1 16 2 16 3 16 4 16 5 49 6 50)}) :bytecode (16 0 52 0 0 1 17 1 16 1 52 1 0 1 17 2 51 2 0 1 2 1 3 17 3 5 16 3 16 1 52 0 0 1 2 2 4 2 2 49 6 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "rest" "=" "len" 4 "list?" 2 "first" dict "list" dom-dispatch "hs-to-sx" 3 me) :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 52 2 0 1 52 2 0 1 17 2 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 39 0 5 16 0 1 7 0 52 0 0 2 52 6 0 1 6 33 21 0 5 16 0 1 7 0 52 0 0 2 52 8 0 1 1 9 0 52 3 0 2 33 40 0 1 11 0 20 12 0 16 0 1 13 0 52 0 0 2 48 1 16 1 20 12 0 16 0 1 7 0 52 0 0 2 48 1 52 10 0 4 32 56 0 16 0 52 4 0 1 1 13 0 52 3 0 2 33 27 0 1 11 0 20 12 0 16 0 1 7 0 52 0 0 2 48 1 16 1 2 52 10 0 4 32 13 0 1 11 0 1 14 0 16 1 2 52 10 0 4 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "hs-to-sx" 2 "list?" "=" "first" forever "list" hs-repeat-forever fn times hs-repeat-times "number?") :bytecode (16 0 1 1 0 52 0 0 2 17 1 20 2 0 16 0 1 3 0 52 0 0 2 48 1 17 2 16 1 52 4 0 1 6 33 14 0 5 16 1 52 6 0 1 1 7 0 52 5 0 2 33 23 0 1 9 0 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 2 32 125 0 16 1 52 4 0 1 6 33 14 0 5 16 1 52 6 0 1 1 11 0 52 5 0 2 33 37 0 1 12 0 20 2 0 16 1 1 1 0 52 0 0 2 48 1 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 3 32 61 0 16 1 52 13 0 1 33 25 0 1 12 0 16 1 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 3 32 27 0 1 12 0 20 2 0 16 1 48 1 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "hs-to-sx" 2 3 ">" "len" 4 "=" "index" "list" for-each fn "make-symbol" 5) :bytecode (16 0 1 1 0 52 0 0 2 17 1 20 2 0 16 0 1 3 0 52 0 0 2 48 1 17 2 20 2 0 16 0 1 4 0 52 0 0 2 48 1 17 3 16 0 52 6 0 1 1 7 0 52 5 0 2 6 33 17 0 5 16 0 1 7 0 52 0 0 2 1 9 0 52 8 0 2 33 44 0 1 11 0 1 12 0 16 1 52 13 0 1 16 0 1 14 0 52 0 0 2 52 13 0 1 52 10 0 2 16 3 52 10 0 3 16 2 52 10 0 3 32 28 0 1 11 0 1 12 0 16 1 52 13 0 1 52 10 0 1 16 3 52 10 0 3 16 2 52 10 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 ">" "len" 2 "=" "from" "list" hs-wait-for "hs-to-sx" 3 me) :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 52 3 0 1 1 4 0 52 2 0 2 6 33 17 0 5 16 0 1 4 0 52 0 0 2 1 6 0 52 5 0 2 33 26 0 1 8 0 20 9 0 16 0 1 10 0 52 0 0 2 48 1 16 1 52 7 0 3 32 12 0 1 8 0 1 11 0 16 1 52 7 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "hs-to-sx" 2 "=" "len" 5 "list" hs-transition 4 3) :bytecode (16 0 1 1 0 52 0 0 2 17 1 20 2 0 16 0 1 3 0 52 0 0 2 48 1 17 2 16 0 52 5 0 1 1 6 0 52 4 0 2 33 37 0 1 8 0 20 2 0 16 0 1 9 0 52 0 0 2 48 1 16 1 16 2 16 0 1 10 0 52 0 0 2 52 7 0 5 32 26 0 1 8 0 20 2 0 16 0 1 10 0 52 0 0 2 48 1 16 1 16 2 2 52 7 0 5 50)} {:upvalue-count 0 :arity 1 :constants ("=" "len" 3 "list" let "make-symbol" "nth" 2 hs-make 1) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 60 0 1 4 0 16 0 1 7 0 52 6 0 2 52 5 0 1 1 8 0 16 0 1 9 0 52 6 0 2 52 3 0 2 52 3 0 2 52 3 0 1 16 0 1 7 0 52 6 0 2 52 5 0 1 52 3 0 3 32 16 0 1 8 0 16 0 1 9 0 52 6 0 2 52 3 0 2 50)} {:upvalue-count 1 :arity 3 :constants ("list?" "=" "first" attr "hs-to-sx" me "list" dom-set-attr "nth" 1 + parse-number dom-get-attr 2 host-set host-get style dom-set-style dom-get-style set!) :bytecode (16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 3 0 52 1 0 2 33 75 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 1 7 0 16 3 16 0 1 9 0 52 8 0 2 1 10 0 1 11 0 1 12 0 16 3 16 0 1 9 0 52 8 0 2 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 222 0 16 0 52 0 0 1 6 33 13 0 5 16 0 52 2 0 1 18 0 52 1 0 2 33 68 0 20 4 0 16 0 1 9 0 52 8 0 2 48 1 17 3 16 0 1 13 0 52 8 0 2 17 4 1 14 0 16 3 16 4 1 10 0 1 11 0 1 15 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 128 0 16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 16 0 52 1 0 2 33 72 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 16 0 1 9 0 52 8 0 2 17 4 1 17 0 16 3 16 4 1 10 0 1 11 0 1 18 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 29 0 20 4 0 16 0 48 1 17 3 1 19 0 16 3 1 10 0 16 3 16 1 52 6 0 3 52 6 0 3 50)} {:upvalue-count 1 :arity 3 :constants ("list?" "=" "first" attr "hs-to-sx" me "list" dom-set-attr "nth" 1 - parse-number dom-get-attr 2 host-set host-get style dom-set-style dom-get-style set!) :bytecode (16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 3 0 52 1 0 2 33 75 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 1 7 0 16 3 16 0 1 9 0 52 8 0 2 1 10 0 1 11 0 1 12 0 16 3 16 0 1 9 0 52 8 0 2 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 222 0 16 0 52 0 0 1 6 33 13 0 5 16 0 52 2 0 1 18 0 52 1 0 2 33 68 0 20 4 0 16 0 1 9 0 52 8 0 2 48 1 17 3 16 0 1 13 0 52 8 0 2 17 4 1 14 0 16 3 16 4 1 10 0 1 11 0 1 15 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 128 0 16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 16 0 52 1 0 2 33 72 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 16 0 1 9 0 52 8 0 2 17 4 1 17 0 16 3 16 4 1 10 0 1 11 0 1 18 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 29 0 20 4 0 16 0 48 1 17 3 1 19 0 16 3 1 10 0 16 3 16 1 52 6 0 3 52 6 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 2 3 "list" define "make-symbol" fn "cons" me "map" do "hs-to-sx") :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 17 2 16 0 1 3 0 52 0 0 2 17 3 1 5 0 16 1 52 6 0 1 1 7 0 1 9 0 20 6 0 16 2 52 10 0 2 52 8 0 2 1 11 0 20 12 0 16 3 52 10 0 2 52 8 0 2 52 4 0 3 52 4 0 3 50)} {:upvalue-count 13 :arity 1 :constants ("nil?" "number?" "string?" "boolean?" "not" "list?" "first" "=" null-literal object-literal "nth" 1 "len" 0 "list" dict "cons" hs-make-object list "map" {:upvalue-count 0 :arity 1 :constants ("list" list "first" "hs-to-sx" "nth" 1) :bytecode (1 1 0 16 0 52 2 0 1 20 3 0 16 0 1 5 0 52 4 0 2 48 1 52 0 0 3 50)} template "" {:upvalue-count 2 :arity 0 :constants (">" "len" 0 "append" "list" "") :bytecode (18 0 52 1 0 1 1 2 0 52 0 0 2 33 23 0 18 1 18 0 52 4 0 1 52 3 0 2 19 1 5 1 5 0 19 0 32 1 0 2 50)} {:upvalue-count 3 :arity 1 :constants ("<" "nth" ">=" "a" "<=" "z" "A" "Z" "0" "9" "=" "_" "." "+" 1) :bytecode (16 0 18 0 52 0 0 2 6 33 118 0 5 18 1 16 0 52 1 0 2 17 1 16 1 1 3 0 52 2 0 2 6 33 10 0 5 16 1 1 5 0 52 4 0 2 6 34 80 0 5 16 1 1 6 0 52 2 0 2 6 33 10 0 5 16 1 1 7 0 52 4 0 2 6 34 52 0 5 16 1 1 8 0 52 2 0 2 6 33 10 0 5 16 1 1 9 0 52 4 0 2 6 34 24 0 5 16 1 1 11 0 52 10 0 2 6 34 10 0 5 16 1 1 12 0 52 10 0 2 33 16 0 18 2 16 0 1 14 0 52 13 0 2 49 1 32 2 0 16 0 50)} {:upvalue-count 3 :arity 2 :constants (">=" "=" "nth" "}" 1 "+" "-" "{") :bytecode (16 0 18 0 52 0 0 2 33 5 0 16 0 32 118 0 18 1 16 0 52 2 0 2 1 3 0 52 1 0 2 33 42 0 16 1 1 4 0 52 1 0 2 33 5 0 16 0 32 22 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 6 0 2 49 2 32 58 0 18 1 16 0 52 2 0 2 1 7 0 52 1 0 2 33 25 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 5 0 2 49 2 32 15 0 18 2 16 0 1 4 0 52 5 0 2 16 1 49 2 50)} {:upvalue-count 9 :arity 0 :constants ("<" "nth" "=" "$" "+" 1 "{" 2 "slice" "append" "list" "hs-to-sx" "hs-compile" "str") :bytecode (18 0 18 1 52 0 0 2 33 253 0 18 2 18 0 52 1 0 2 17 0 16 0 1 3 0 52 2 0 2 6 33 16 0 5 18 0 1 5 0 52 4 0 2 18 1 52 0 0 2 33 181 0 18 2 18 0 1 5 0 52 4 0 2 52 1 0 2 1 6 0 52 2 0 2 33 83 0 18 0 1 7 0 52 4 0 2 17 1 18 3 16 1 1 5 0 48 2 17 2 18 2 16 1 16 2 52 8 0 3 17 3 18 4 48 0 5 18 5 20 11 0 20 12 0 16 3 48 1 48 1 52 10 0 1 52 9 0 2 19 5 5 16 2 1 5 0 52 4 0 2 19 0 5 18 6 49 0 32 70 0 18 0 1 5 0 52 4 0 2 17 1 18 7 16 1 48 1 17 2 18 2 16 1 16 2 52 8 0 3 17 3 18 4 48 0 5 18 5 20 11 0 20 12 0 16 3 48 1 48 1 52 10 0 1 52 9 0 2 19 5 5 16 2 19 0 5 18 6 49 0 32 27 0 18 8 16 0 52 13 0 2 19 8 5 18 0 1 5 0 52 4 0 2 19 0 5 18 6 49 0 32 1 0 2 50)} str beep! hs-beep "hs-to-sx" array-index nth 2 array-slice hs-slice 3 prop-is hs-prop-is coll-where filter fn it coll-sorted hs-sorted-by coll-sorted-desc hs-sorted-by-desc coll-mapped map coll-split hs-split-by coll-joined hs-joined-by method-call "make-symbol" "." hs-method-call string-postfix block-literal me event hs-first "last" hs-last host-get ref query hs-query-first attr dom-get-attr style dom-get-style local array "rest" not no hs-falsy? and or = + hs-add - * / "%" modulo empty? hs-empty? exists? nil? matches? hs-matches? contains? hs-contains? as hs-coerce in? of first last "!=" "<" < ">" > "<=" <= ">=" >= closest dom-closest next hs-next previous hs-previous hs-query-last add-class dom-add-class multi-add-class do {:upvalue-count 1 :arity 1 :constants ("list" dom-add-class) :bytecode (1 1 0 18 0 16 0 52 0 0 3 50)} multi-remove-class {:upvalue-count 1 :arity 1 :constants ("list" dom-remove-class) :bytecode (1 1 0 18 0 16 0 52 0 0 3 50)} remove-class dom-remove-class toggle-class hs-toggle-class! toggle-between hs-toggle-between! toggle-style hs-toggle-style! toggle-style-between hs-toggle-style-between! 4 toggle-attr hs-toggle-attr! toggle-attr-between hs-toggle-attr-between! set! put! hs-put! if when wait hs-wait wait-for log console-log send trigger dom-dispatch hide "display" "opacity" dom-set-style "0" "visibility" "hidden" "none" show "1" "visible" transition repeat fetch hs-fetch call return throw raise settle hs-settle go hs-navigate! append! dom-append tell let for take! hs-query-all hs-take! make install hs-install measure hs-measure increment! decrement! on init hs-init def define behavior sx-eval "sx-parse" cek-eval component render {:upvalue-count 1 :arity 1 :constants ("<" "len" 2 "list" "cons" "make-keyword" "first" "hs-to-sx" "nth" 1 "rest") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 7 0 52 3 0 0 32 46 0 16 0 52 6 0 1 52 5 0 1 20 7 0 16 0 1 9 0 52 8 0 2 48 1 18 0 16 0 52 10 0 1 52 10 0 1 48 1 52 4 0 2 52 4 0 2 50)} render-to-html not-in? type-check hs-type-check type-check-strict hs-type-check-strict strict-eq hs-strict-eq some every every? scroll! hs-scroll! select! hs-select! reset! hs-reset! default! halt! hs-halt!) :bytecode (16 0 52 0 0 1 33 4 0 2 32 164 23 16 0 52 1 0 1 33 5 0 16 0 32 150 23 16 0 52 2 0 1 33 5 0 16 0 32 136 23 16 0 52 3 0 1 33 5 0 16 0 32 122 23 16 0 52 5 0 1 52 4 0 1 33 5 0 16 0 32 104 23 16 0 52 6 0 1 17 1 16 1 1 8 0 52 7 0 2 33 4 0 2 32 80 23 16 1 1 9 0 52 7 0 2 33 67 0 16 0 1 11 0 52 10 0 2 17 2 16 2 52 12 0 1 1 13 0 52 7 0 2 33 10 0 1 15 0 52 14 0 1 32 27 0 1 17 0 1 18 0 51 20 0 16 2 52 19 0 2 52 16 0 2 52 14 0 1 52 16 0 2 32 1 23 16 1 1 21 0 52 7 0 2 33 115 0 16 0 1 11 0 52 10 0 2 17 2 52 14 0 0 17 3 1 22 0 17 4 1 13 0 17 5 16 2 52 12 0 1 17 6 51 23 0 1 4 1 3 17 7 5 51 24 0 1 6 1 2 1 8 17 8 5 51 25 0 1 6 1 2 1 9 17 9 5 51 26 0 1 5 1 6 1 2 1 9 1 7 1 3 1 10 1 8 1 4 17 10 5 16 10 48 0 5 16 7 48 0 5 1 27 0 16 3 52 16 0 2 32 130 22 16 1 1 28 0 52 7 0 2 33 24 0 1 29 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 94 22 16 1 1 31 0 52 7 0 2 33 38 0 1 32 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 44 22 16 1 1 34 0 52 7 0 2 33 52 0 1 35 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 4 32 236 21 16 1 1 37 0 52 7 0 2 33 33 0 1 38 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 191 21 16 1 1 39 0 52 7 0 2 33 52 0 1 40 0 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 127 21 16 1 1 43 0 52 7 0 2 33 52 0 1 44 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 52 14 0 3 32 63 21 16 1 1 45 0 52 7 0 2 33 52 0 1 46 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 52 14 0 3 32 255 20 16 1 1 47 0 52 7 0 2 33 52 0 1 48 0 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 191 20 16 1 1 49 0 52 7 0 2 33 38 0 1 50 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 141 20 16 1 1 51 0 52 7 0 2 33 38 0 1 52 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 91 20 16 1 1 53 0 52 7 0 2 33 134 0 16 0 1 11 0 52 10 0 2 17 2 20 30 0 16 0 1 33 0 52 10 0 2 52 19 0 2 17 3 16 2 52 5 0 1 6 33 18 0 5 16 2 52 6 0 1 1 55 0 52 54 0 1 52 7 0 2 33 51 0 20 30 0 16 2 1 11 0 52 10 0 2 48 1 17 4 16 2 1 33 0 52 10 0 2 17 5 1 56 0 16 4 16 5 16 3 52 16 0 2 52 16 0 2 52 16 0 2 32 20 0 1 56 0 20 30 0 16 2 48 1 16 3 52 16 0 2 52 16 0 2 32 201 19 16 1 1 57 0 52 7 0 2 33 33 0 1 27 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 156 19 16 1 1 58 0 52 7 0 2 33 69 0 20 54 0 16 0 1 11 0 52 10 0 2 52 19 0 2 17 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 17 3 16 2 52 12 0 1 1 13 0 52 7 0 2 33 5 0 16 3 32 11 0 1 41 0 16 2 16 3 52 14 0 3 32 75 19 16 1 1 59 0 52 7 0 2 33 6 0 1 59 0 32 57 19 16 1 1 42 0 52 7 0 2 33 6 0 1 42 0 32 39 19 16 1 1 60 0 52 7 0 2 33 6 0 1 60 0 32 21 19 16 1 18 0 52 7 0 2 33 89 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 1 33 0 52 10 0 2 17 3 16 3 1 6 0 52 7 0 2 33 12 0 1 61 0 16 2 52 14 0 2 32 35 0 16 3 1 62 0 52 7 0 2 33 12 0 1 63 0 16 2 52 14 0 2 32 11 0 1 64 0 16 2 16 3 52 14 0 3 32 177 18 16 1 1 65 0 52 7 0 2 33 16 0 16 0 1 11 0 52 10 0 2 52 54 0 1 32 149 18 16 1 1 66 0 52 7 0 2 33 19 0 1 67 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 118 18 16 1 1 68 0 52 7 0 2 33 33 0 1 69 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 73 18 16 1 1 70 0 52 7 0 2 33 33 0 1 71 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 28 18 16 1 1 72 0 52 7 0 2 33 16 0 16 0 1 11 0 52 10 0 2 52 54 0 1 32 0 18 16 1 1 73 0 52 7 0 2 33 23 0 1 18 0 20 30 0 16 0 52 74 0 1 52 19 0 2 52 16 0 2 32 221 17 16 1 1 75 0 52 7 0 2 33 24 0 1 75 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 185 17 16 1 1 76 0 52 7 0 2 33 24 0 1 77 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 149 17 16 1 1 78 0 52 7 0 2 33 38 0 1 78 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 99 17 16 1 1 79 0 52 7 0 2 33 38 0 1 79 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 49 17 16 1 1 80 0 52 7 0 2 33 38 0 1 80 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 255 16 16 1 1 81 0 52 7 0 2 33 38 0 1 82 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 205 16 16 1 1 83 0 52 7 0 2 33 38 0 1 83 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 155 16 16 1 1 84 0 52 7 0 2 33 38 0 1 84 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 105 16 16 1 1 85 0 52 7 0 2 33 38 0 1 85 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 55 16 16 1 18 1 52 7 0 2 33 81 0 16 0 1 33 0 52 10 0 2 52 0 0 1 33 27 0 1 27 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 1 86 0 52 14 0 3 32 35 0 1 87 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 219 15 16 1 1 88 0 52 7 0 2 33 24 0 1 89 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 183 15 16 1 1 90 0 52 7 0 2 33 31 0 1 75 0 1 91 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 52 14 0 2 32 140 15 16 1 1 92 0 52 7 0 2 33 38 0 1 93 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 90 15 16 1 1 94 0 52 7 0 2 33 38 0 1 95 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 40 15 16 1 1 96 0 52 7 0 2 33 33 0 1 97 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 251 14 16 1 1 98 0 52 7 0 2 33 38 0 1 95 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 201 14 16 1 1 99 0 52 7 0 2 33 94 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 17 3 16 2 1 100 0 52 7 0 2 33 12 0 1 100 0 16 3 52 14 0 2 32 35 0 16 2 1 101 0 52 7 0 2 33 12 0 1 101 0 16 3 52 14 0 2 32 11 0 1 64 0 16 3 16 2 52 14 0 3 32 95 14 16 1 1 102 0 52 7 0 2 33 45 0 1 75 0 1 80 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 52 14 0 2 32 38 14 16 1 1 103 0 52 7 0 2 33 38 0 1 104 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 244 13 16 1 1 105 0 52 7 0 2 33 38 0 1 106 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 194 13 16 1 1 107 0 52 7 0 2 33 38 0 1 108 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 144 13 16 1 1 109 0 52 7 0 2 33 38 0 1 110 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 94 13 16 1 1 111 0 52 7 0 2 33 33 0 1 112 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 49 13 16 1 1 113 0 52 7 0 2 33 33 0 1 114 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 4 13 16 1 1 115 0 52 7 0 2 33 33 0 1 116 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 215 12 16 1 1 100 0 52 7 0 2 33 68 0 16 0 52 12 0 1 1 33 0 52 105 0 2 33 33 0 1 61 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 16 0 1 67 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 135 12 16 1 1 101 0 52 7 0 2 33 68 0 16 0 52 12 0 1 1 33 0 52 105 0 2 33 33 0 1 63 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 16 0 1 117 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 55 12 16 1 1 118 0 52 7 0 2 33 33 0 1 119 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 10 12 16 1 1 120 0 52 7 0 2 33 49 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 74 0 1 52 74 0 1 17 3 1 121 0 51 122 0 1 2 16 3 52 19 0 2 52 16 0 2 32 205 11 16 1 1 123 0 52 7 0 2 33 49 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 74 0 1 52 74 0 1 17 3 1 121 0 51 124 0 1 2 16 3 52 19 0 2 52 16 0 2 32 144 11 16 1 1 125 0 52 7 0 2 33 33 0 1 126 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 99 11 16 1 1 127 0 52 7 0 2 33 33 0 1 128 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 54 11 16 1 1 129 0 52 7 0 2 33 42 0 1 130 0 20 30 0 16 0 1 36 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 16 0 1 33 0 52 10 0 2 52 14 0 4 32 0 11 16 1 1 131 0 52 7 0 2 33 33 0 1 132 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 211 10 16 1 1 133 0 52 7 0 2 33 61 0 1 134 0 20 30 0 16 0 1 135 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 5 32 138 10 16 1 1 136 0 52 7 0 2 33 33 0 1 137 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 93 10 16 1 1 138 0 52 7 0 2 33 61 0 1 139 0 20 30 0 16 0 1 135 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 5 32 20 10 16 1 1 140 0 52 7 0 2 33 30 0 18 2 16 0 1 11 0 52 10 0 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 49 2 32 234 9 16 1 1 141 0 52 7 0 2 33 47 0 1 142 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 4 32 175 9 16 1 1 143 0 52 7 0 2 33 106 0 16 0 52 12 0 1 1 36 0 52 105 0 2 33 52 0 1 143 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 4 32 35 0 1 144 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 57 9 16 1 1 121 0 52 7 0 2 33 23 0 1 121 0 20 30 0 16 0 52 74 0 1 52 19 0 2 52 16 0 2 32 22 9 16 1 1 145 0 52 7 0 2 33 19 0 1 146 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 247 8 16 1 1 147 0 52 7 0 2 33 9 0 18 3 16 0 49 1 32 226 8 16 1 1 148 0 52 7 0 2 33 24 0 1 149 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 190 8 16 1 1 150 0 52 7 0 2 33 9 0 18 4 16 0 49 1 32 169 8 16 1 1 151 0 52 7 0 2 33 34 0 1 152 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 2 52 14 0 4 32 123 8 16 1 1 153 0 52 7 0 2 33 127 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 12 0 1 1 33 0 52 105 0 2 33 12 0 16 0 1 33 0 52 10 0 2 32 3 0 1 154 0 17 3 16 3 1 155 0 52 7 0 2 33 18 0 1 156 0 16 2 1 155 0 1 157 0 52 14 0 4 32 45 0 16 3 1 158 0 52 7 0 2 33 18 0 1 156 0 16 2 1 158 0 1 159 0 52 14 0 4 32 15 0 1 156 0 16 2 1 154 0 1 160 0 52 14 0 4 32 240 7 16 1 1 161 0 52 7 0 2 33 127 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 12 0 1 1 33 0 52 105 0 2 33 12 0 16 0 1 33 0 52 10 0 2 32 3 0 1 154 0 17 3 16 3 1 155 0 52 7 0 2 33 18 0 1 156 0 16 2 1 155 0 1 162 0 52 14 0 4 32 45 0 16 3 1 158 0 52 7 0 2 33 18 0 1 156 0 16 2 1 158 0 1 163 0 52 14 0 4 32 15 0 1 156 0 16 2 1 154 0 1 22 0 52 14 0 4 32 101 7 16 1 1 164 0 52 7 0 2 33 9 0 18 5 16 0 49 1 32 80 7 16 1 1 165 0 52 7 0 2 33 9 0 18 6 16 0 49 1 32 59 7 16 1 1 166 0 52 7 0 2 33 33 0 1 167 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 14 7 16 1 1 168 0 52 7 0 2 33 45 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 20 30 0 16 0 1 33 0 52 10 0 2 52 19 0 2 17 3 16 2 16 3 52 16 0 2 32 213 6 16 1 1 169 0 52 7 0 2 33 17 0 20 30 0 16 0 1 11 0 52 10 0 2 49 1 32 184 6 16 1 1 170 0 52 7 0 2 33 24 0 1 171 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 148 6 16 1 1 172 0 52 7 0 2 33 13 0 1 173 0 1 59 0 52 14 0 2 32 123 6 16 1 1 174 0 52 7 0 2 33 24 0 1 175 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 87 6 16 1 1 176 0 52 7 0 2 33 38 0 1 177 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 37 6 16 1 1 178 0 52 7 0 2 33 49 0 1 179 0 1 59 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 232 5 16 1 1 180 0 52 7 0 2 33 9 0 18 7 16 0 49 1 32 211 5 16 1 1 181 0 52 7 0 2 33 190 0 16 0 1 11 0 52 10 0 2 17 2 16 0 1 33 0 52 10 0 2 17 3 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 17 4 16 0 52 12 0 1 1 135 0 52 105 0 2 33 12 0 16 0 1 135 0 52 10 0 2 32 1 0 2 17 5 16 5 33 10 0 20 30 0 16 5 48 1 32 3 0 1 59 0 17 6 16 4 52 0 0 1 33 4 0 2 32 53 0 16 4 52 5 0 1 6 33 14 0 5 16 4 52 6 0 1 1 66 0 52 7 0 2 33 19 0 1 182 0 16 4 1 11 0 52 10 0 2 52 14 0 2 32 7 0 20 30 0 16 4 48 1 17 7 1 183 0 16 6 16 2 16 3 16 7 52 14 0 5 32 9 5 16 1 1 184 0 52 7 0 2 33 9 0 18 8 16 0 49 1 32 244 4 16 1 1 185 0 52 7 0 2 33 23 0 1 186 0 20 30 0 16 0 52 74 0 1 52 19 0 2 52 16 0 2 32 209 4 16 1 1 187 0 52 7 0 2 33 24 0 1 188 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 173 4 16 1 1 189 0 52 7 0 2 33 54 0 18 9 16 0 1 11 0 52 10 0 2 16 0 1 33 0 52 10 0 2 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 49 3 32 107 4 16 1 1 190 0 52 7 0 2 33 54 0 18 10 16 0 1 11 0 52 10 0 2 16 0 1 33 0 52 10 0 2 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 49 3 32 41 4 16 1 1 191 0 52 7 0 2 33 9 0 18 11 16 0 49 1 32 20 4 16 1 1 192 0 52 7 0 2 33 35 0 1 193 0 1 41 0 52 14 0 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 52 14 0 2 32 229 3 16 1 1 194 0 52 7 0 2 33 60 0 1 195 0 16 0 1 11 0 52 10 0 2 52 54 0 1 1 41 0 20 54 0 16 0 1 33 0 52 10 0 2 52 19 0 2 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 3 52 14 0 3 32 157 3 16 1 1 196 0 52 7 0 2 33 9 0 18 12 16 0 49 1 32 136 3 16 1 1 197 0 52 7 0 2 33 51 0 16 0 1 11 0 52 10 0 2 17 2 16 2 52 2 0 1 33 14 0 20 198 0 16 2 48 1 52 6 0 1 32 14 0 1 199 0 20 30 0 16 2 48 1 52 14 0 2 32 73 3 16 1 1 200 0 52 7 0 2 33 16 0 16 0 1 11 0 52 10 0 2 52 54 0 1 32 45 3 16 1 1 201 0 52 7 0 2 33 182 0 16 0 1 11 0 52 10 0 2 17 2 16 0 1 33 0 52 10 0 2 17 3 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 17 4 16 0 52 12 0 1 1 135 0 52 105 0 2 33 17 0 20 30 0 16 0 1 135 0 52 10 0 2 48 1 32 1 0 2 17 5 16 2 52 2 0 1 33 9 0 16 2 52 54 0 1 32 7 0 20 30 0 16 2 48 1 17 6 51 202 0 1 7 17 7 5 1 203 0 16 6 16 7 16 3 48 1 52 16 0 2 52 16 0 2 17 8 16 4 33 27 0 1 142 0 16 8 16 4 16 5 33 5 0 16 5 32 3 0 1 59 0 52 14 0 4 32 2 0 16 8 32 107 2 16 1 1 204 0 52 7 0 2 33 45 0 1 75 0 1 95 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 52 14 0 2 32 50 2 16 1 1 98 0 52 7 0 2 33 38 0 1 95 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 0 2 16 1 1 205 0 52 7 0 2 33 33 0 1 206 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 211 1 16 1 1 207 0 52 7 0 2 33 33 0 1 208 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 166 1 16 1 1 209 0 52 7 0 2 33 38 0 1 210 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 116 1 16 1 1 211 0 52 7 0 2 33 62 0 1 211 0 1 41 0 16 0 1 11 0 52 10 0 2 52 54 0 1 52 14 0 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 42 1 16 1 1 212 0 52 7 0 2 33 62 0 1 213 0 1 41 0 16 0 1 11 0 52 10 0 2 52 54 0 1 52 14 0 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 224 0 16 1 1 214 0 52 7 0 2 33 33 0 1 215 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 179 0 16 1 1 216 0 52 7 0 2 33 24 0 1 217 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 143 0 16 1 1 218 0 52 7 0 2 33 24 0 1 219 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 107 0 16 1 1 220 0 52 7 0 2 33 62 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 17 3 1 144 0 1 91 0 16 2 52 14 0 2 1 140 0 16 2 16 3 52 14 0 3 52 14 0 3 32 33 0 16 1 1 221 0 52 7 0 2 33 19 0 1 222 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 2 0 16 0 50)} "hs-to-sx-from-source" {:upvalue-count 0 :arity 1 :constants ("hs-to-sx" "hs-compile") :bytecode (20 0 0 20 1 0 16 0 48 1 49 1 50)}) :bytecode (1 2 0 52 1 0 1 17 0 1 3 0 52 1 0 1 17 1 51 4 0 17 2 5 51 5 0 1 0 17 3 5 51 6 0 17 4 5 51 7 0 17 5 5 51 8 0 17 6 5 51 9 0 17 7 5 51 10 0 17 8 5 51 11 0 17 9 5 51 12 0 17 10 5 51 13 0 1 0 17 11 5 51 14 0 1 0 17 12 5 51 15 0 17 13 5 51 16 0 1 0 1 1 1 3 1 8 1 5 1 9 1 6 1 7 1 10 1 11 1 12 1 4 1 13 128 0 0 5 51 18 0 128 17 0 50))) + :constants ("hs-to-sx" "make-symbol" "." "%" {:upvalue-count 0 :arity 1 :constants ("hs-to-sx") :bytecode (20 0 0 16 0 49 1 50)} {:upvalue-count 1 :arity 2 :constants ("not" "list?" "list" set! "first" "=" dom-set-prop "hs-to-sx" "nth" 1 2 attr dom-set-attr style dom-set-style ref "make-symbol" local me dom-set-inner-html it query) :bytecode (16 0 52 1 0 1 52 0 0 1 33 14 0 1 3 0 16 0 16 1 52 2 0 3 32 67 1 16 0 52 4 0 1 17 2 16 2 18 0 52 5 0 2 33 35 0 1 6 0 20 7 0 16 0 1 9 0 52 8 0 2 48 1 16 0 1 10 0 52 8 0 2 16 1 52 2 0 4 32 13 1 16 2 1 11 0 52 5 0 2 33 35 0 1 12 0 20 7 0 16 0 1 10 0 52 8 0 2 48 1 16 0 1 9 0 52 8 0 2 16 1 52 2 0 4 32 222 0 16 2 1 13 0 52 5 0 2 33 35 0 1 14 0 20 7 0 16 0 1 10 0 52 8 0 2 48 1 16 0 1 9 0 52 8 0 2 16 1 52 2 0 4 32 175 0 16 2 1 15 0 52 5 0 2 33 25 0 1 3 0 16 0 1 9 0 52 8 0 2 52 16 0 1 16 1 52 2 0 3 32 138 0 16 2 1 17 0 52 5 0 2 33 25 0 1 3 0 16 0 1 9 0 52 8 0 2 52 16 0 1 16 1 52 2 0 3 32 101 0 16 2 1 18 0 52 5 0 2 33 15 0 1 19 0 1 18 0 16 1 52 2 0 3 32 74 0 16 2 1 20 0 52 5 0 2 33 15 0 1 3 0 1 20 0 16 1 52 2 0 3 32 47 0 16 2 1 21 0 52 5 0 2 33 19 0 1 19 0 20 7 0 16 0 48 1 16 1 52 2 0 3 32 16 0 1 3 0 20 7 0 16 0 48 1 16 1 52 2 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("rest" "first" {:upvalue-count 2 :arity 6 :constants ("<=" "len" 1 ">" 0 "first" "hs-to-sx" me "make-symbol" "nth" "list" do guard fn event hs-on-every hs-on "=" "from" "rest" "filter" "every" "catch" "finally") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 242 0 16 0 52 1 0 1 1 4 0 52 3 0 2 33 9 0 16 0 52 5 0 1 32 1 0 2 17 6 16 1 33 10 0 20 6 0 16 1 48 1 32 3 0 1 7 0 17 7 20 6 0 16 6 48 1 17 8 16 4 33 97 0 16 4 52 5 0 1 52 8 0 1 17 9 20 6 0 16 4 1 2 0 52 9 0 2 48 1 17 10 16 5 33 39 0 1 11 0 1 12 0 16 9 3 16 10 52 10 0 2 52 10 0 2 16 8 52 10 0 3 20 6 0 16 5 48 1 52 10 0 3 32 22 0 1 12 0 16 9 3 16 10 52 10 0 2 52 10 0 2 16 8 52 10 0 3 32 26 0 16 5 33 19 0 1 11 0 16 8 20 6 0 16 5 48 1 52 10 0 3 32 2 0 16 8 17 9 1 13 0 1 14 0 52 10 0 1 16 9 52 10 0 3 17 10 16 3 33 16 0 1 15 0 16 7 18 0 16 10 52 10 0 4 32 13 0 1 16 0 16 7 18 0 16 10 52 10 0 4 32 6 1 16 0 52 5 0 1 1 18 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 0 1 2 0 52 9 0 2 16 2 16 3 16 4 16 5 49 6 32 212 0 16 0 52 5 0 1 1 20 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 0 1 2 0 52 9 0 2 16 3 16 4 16 5 49 6 32 162 0 16 0 52 5 0 1 1 21 0 52 17 0 2 33 26 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 2 3 16 4 16 5 49 6 32 120 0 16 0 52 5 0 1 1 22 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 2 16 3 16 0 1 2 0 52 9 0 2 16 5 49 6 32 70 0 16 0 52 5 0 1 1 23 0 52 17 0 2 33 34 0 18 1 16 0 52 19 0 1 52 19 0 1 16 1 16 2 16 3 16 4 16 0 1 2 0 52 9 0 2 49 6 32 20 0 18 1 16 0 52 19 0 1 16 1 16 2 16 3 16 4 16 5 49 6 50)}) :bytecode (16 0 52 0 0 1 17 1 16 1 52 1 0 1 17 2 51 2 0 1 2 1 3 17 3 5 16 3 16 1 52 0 0 1 2 2 4 2 2 49 6 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "rest" "=" "len" 4 "list?" 2 "first" dict "list" dom-dispatch "hs-to-sx" 3 me) :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 52 2 0 1 52 2 0 1 17 2 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 39 0 5 16 0 1 7 0 52 0 0 2 52 6 0 1 6 33 21 0 5 16 0 1 7 0 52 0 0 2 52 8 0 1 1 9 0 52 3 0 2 33 40 0 1 11 0 20 12 0 16 0 1 13 0 52 0 0 2 48 1 16 1 20 12 0 16 0 1 7 0 52 0 0 2 48 1 52 10 0 4 32 56 0 16 0 52 4 0 1 1 13 0 52 3 0 2 33 27 0 1 11 0 20 12 0 16 0 1 7 0 52 0 0 2 48 1 16 1 2 52 10 0 4 32 13 0 1 11 0 1 14 0 16 1 2 52 10 0 4 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "hs-to-sx" 2 "list?" "=" "first" forever "list" hs-repeat-forever fn times hs-repeat-times "number?") :bytecode (16 0 1 1 0 52 0 0 2 17 1 20 2 0 16 0 1 3 0 52 0 0 2 48 1 17 2 16 1 52 4 0 1 6 33 14 0 5 16 1 52 6 0 1 1 7 0 52 5 0 2 33 23 0 1 9 0 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 2 32 125 0 16 1 52 4 0 1 6 33 14 0 5 16 1 52 6 0 1 1 11 0 52 5 0 2 33 37 0 1 12 0 20 2 0 16 1 1 1 0 52 0 0 2 48 1 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 3 32 61 0 16 1 52 13 0 1 33 25 0 1 12 0 16 1 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 3 32 27 0 1 12 0 20 2 0 16 1 48 1 1 10 0 52 8 0 0 16 2 52 8 0 3 52 8 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "hs-to-sx" 2 3 ">" "len" 4 "=" "index" "list" for-each fn "make-symbol" 5) :bytecode (16 0 1 1 0 52 0 0 2 17 1 20 2 0 16 0 1 3 0 52 0 0 2 48 1 17 2 20 2 0 16 0 1 4 0 52 0 0 2 48 1 17 3 16 0 52 6 0 1 1 7 0 52 5 0 2 6 33 17 0 5 16 0 1 7 0 52 0 0 2 1 9 0 52 8 0 2 33 44 0 1 11 0 1 12 0 16 1 52 13 0 1 16 0 1 14 0 52 0 0 2 52 13 0 1 52 10 0 2 16 3 52 10 0 3 16 2 52 10 0 3 32 28 0 1 11 0 1 12 0 16 1 52 13 0 1 52 10 0 1 16 3 52 10 0 3 16 2 52 10 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 ">" "len" 2 "=" "from" "list" hs-wait-for "hs-to-sx" 3 me) :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 52 3 0 1 1 4 0 52 2 0 2 6 33 17 0 5 16 0 1 4 0 52 0 0 2 1 6 0 52 5 0 2 33 26 0 1 8 0 20 9 0 16 0 1 10 0 52 0 0 2 48 1 16 1 52 7 0 3 32 12 0 1 8 0 1 11 0 16 1 52 7 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 "hs-to-sx" 2 "=" "len" 5 "list" hs-transition 4 3) :bytecode (16 0 1 1 0 52 0 0 2 17 1 20 2 0 16 0 1 3 0 52 0 0 2 48 1 17 2 16 0 52 5 0 1 1 6 0 52 4 0 2 33 37 0 1 8 0 20 2 0 16 0 1 9 0 52 0 0 2 48 1 16 1 16 2 16 0 1 10 0 52 0 0 2 52 7 0 5 32 26 0 1 8 0 20 2 0 16 0 1 10 0 52 0 0 2 48 1 16 1 16 2 2 52 7 0 5 50)} {:upvalue-count 0 :arity 1 :constants ("=" "len" 3 "list" let "make-symbol" "nth" 2 hs-make 1) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 60 0 1 4 0 16 0 1 7 0 52 6 0 2 52 5 0 1 1 8 0 16 0 1 9 0 52 6 0 2 52 3 0 2 52 3 0 2 52 3 0 1 16 0 1 7 0 52 6 0 2 52 5 0 1 52 3 0 3 32 16 0 1 8 0 16 0 1 9 0 52 6 0 2 52 3 0 2 50)} {:upvalue-count 1 :arity 3 :constants ("list?" "=" "first" attr "hs-to-sx" me "list" dom-set-attr "nth" 1 + parse-number dom-get-attr 2 host-set host-get style dom-set-style dom-get-style set!) :bytecode (16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 3 0 52 1 0 2 33 75 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 1 7 0 16 3 16 0 1 9 0 52 8 0 2 1 10 0 1 11 0 1 12 0 16 3 16 0 1 9 0 52 8 0 2 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 222 0 16 0 52 0 0 1 6 33 13 0 5 16 0 52 2 0 1 18 0 52 1 0 2 33 68 0 20 4 0 16 0 1 9 0 52 8 0 2 48 1 17 3 16 0 1 13 0 52 8 0 2 17 4 1 14 0 16 3 16 4 1 10 0 1 11 0 1 15 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 128 0 16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 16 0 52 1 0 2 33 72 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 16 0 1 9 0 52 8 0 2 17 4 1 17 0 16 3 16 4 1 10 0 1 11 0 1 18 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 29 0 20 4 0 16 0 48 1 17 3 1 19 0 16 3 1 10 0 16 3 16 1 52 6 0 3 52 6 0 3 50)} {:upvalue-count 1 :arity 3 :constants ("list?" "=" "first" attr "hs-to-sx" me "list" dom-set-attr "nth" 1 - parse-number dom-get-attr 2 host-set host-get style dom-set-style dom-get-style set!) :bytecode (16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 3 0 52 1 0 2 33 75 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 1 7 0 16 3 16 0 1 9 0 52 8 0 2 1 10 0 1 11 0 1 12 0 16 3 16 0 1 9 0 52 8 0 2 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 222 0 16 0 52 0 0 1 6 33 13 0 5 16 0 52 2 0 1 18 0 52 1 0 2 33 68 0 20 4 0 16 0 1 9 0 52 8 0 2 48 1 17 3 16 0 1 13 0 52 8 0 2 17 4 1 14 0 16 3 16 4 1 10 0 1 11 0 1 15 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 128 0 16 0 52 0 0 1 6 33 14 0 5 16 0 52 2 0 1 1 16 0 52 1 0 2 33 72 0 16 2 33 10 0 20 4 0 16 2 48 1 32 3 0 1 5 0 17 3 16 0 1 9 0 52 8 0 2 17 4 1 17 0 16 3 16 4 1 10 0 1 11 0 1 18 0 16 3 16 4 52 6 0 3 52 6 0 2 16 1 52 6 0 3 52 6 0 4 32 29 0 20 4 0 16 0 48 1 17 3 1 19 0 16 3 1 10 0 16 3 16 1 52 6 0 3 52 6 0 3 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1 2 3 "list" define "make-symbol" fn "cons" me "map" do "hs-to-sx") :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 17 2 16 0 1 3 0 52 0 0 2 17 3 1 5 0 16 1 52 6 0 1 1 7 0 1 9 0 20 6 0 16 2 52 10 0 2 52 8 0 2 1 11 0 20 12 0 16 3 52 10 0 2 52 8 0 2 52 4 0 3 52 4 0 3 50)} {:upvalue-count 13 :arity 1 :constants ("nil?" "number?" "string?" "boolean?" "not" "list?" "first" "=" null-literal object-literal "nth" 1 "len" 0 "list" dict "cons" hs-make-object list "map" {:upvalue-count 0 :arity 1 :constants ("list" list "first" "hs-to-sx" "nth" 1) :bytecode (1 1 0 16 0 52 2 0 1 20 3 0 16 0 1 5 0 52 4 0 2 48 1 52 0 0 3 50)} template "" {:upvalue-count 2 :arity 0 :constants (">" "len" 0 "append" "list" "") :bytecode (18 0 52 1 0 1 1 2 0 52 0 0 2 33 23 0 18 1 18 0 52 4 0 1 52 3 0 2 19 1 5 1 5 0 19 0 32 1 0 2 50)} {:upvalue-count 3 :arity 1 :constants ("<" "nth" ">=" "a" "<=" "z" "A" "Z" "0" "9" "=" "_" "." "+" 1) :bytecode (16 0 18 0 52 0 0 2 6 33 118 0 5 18 1 16 0 52 1 0 2 17 1 16 1 1 3 0 52 2 0 2 6 33 10 0 5 16 1 1 5 0 52 4 0 2 6 34 80 0 5 16 1 1 6 0 52 2 0 2 6 33 10 0 5 16 1 1 7 0 52 4 0 2 6 34 52 0 5 16 1 1 8 0 52 2 0 2 6 33 10 0 5 16 1 1 9 0 52 4 0 2 6 34 24 0 5 16 1 1 11 0 52 10 0 2 6 34 10 0 5 16 1 1 12 0 52 10 0 2 33 16 0 18 2 16 0 1 14 0 52 13 0 2 49 1 32 2 0 16 0 50)} {:upvalue-count 3 :arity 2 :constants (">=" "=" "nth" "}" 1 "+" "-" "{") :bytecode (16 0 18 0 52 0 0 2 33 5 0 16 0 32 118 0 18 1 16 0 52 2 0 2 1 3 0 52 1 0 2 33 42 0 16 1 1 4 0 52 1 0 2 33 5 0 16 0 32 22 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 6 0 2 49 2 32 58 0 18 1 16 0 52 2 0 2 1 7 0 52 1 0 2 33 25 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 5 0 2 49 2 32 15 0 18 2 16 0 1 4 0 52 5 0 2 16 1 49 2 50)} {:upvalue-count 9 :arity 0 :constants ("<" "nth" "=" "$" "+" 1 "{" 2 "slice" "append" "list" "hs-to-sx" "hs-compile" "str") :bytecode (18 0 18 1 52 0 0 2 33 253 0 18 2 18 0 52 1 0 2 17 0 16 0 1 3 0 52 2 0 2 6 33 16 0 5 18 0 1 5 0 52 4 0 2 18 1 52 0 0 2 33 181 0 18 2 18 0 1 5 0 52 4 0 2 52 1 0 2 1 6 0 52 2 0 2 33 83 0 18 0 1 7 0 52 4 0 2 17 1 18 3 16 1 1 5 0 48 2 17 2 18 2 16 1 16 2 52 8 0 3 17 3 18 4 48 0 5 18 5 20 11 0 20 12 0 16 3 48 1 48 1 52 10 0 1 52 9 0 2 19 5 5 16 2 1 5 0 52 4 0 2 19 0 5 18 6 49 0 32 70 0 18 0 1 5 0 52 4 0 2 17 1 18 7 16 1 48 1 17 2 18 2 16 1 16 2 52 8 0 3 17 3 18 4 48 0 5 18 5 20 11 0 20 12 0 16 3 48 1 48 1 52 10 0 1 52 9 0 2 19 5 5 16 2 19 0 5 18 6 49 0 32 27 0 18 8 16 0 52 13 0 2 19 8 5 18 0 1 5 0 52 4 0 2 19 0 5 18 6 49 0 32 1 0 2 50)} str beep! hs-beep "hs-to-sx" array-index nth 2 array-slice hs-slice 3 prop-is hs-prop-is coll-where filter fn it coll-sorted hs-sorted-by coll-sorted-desc hs-sorted-by-desc coll-mapped map coll-split hs-split-by coll-joined hs-joined-by method-call "make-symbol" "." hs-method-call string-postfix block-literal me event hs-first "last" hs-last host-get ref query hs-query-first attr dom-get-attr style dom-get-style local array "rest" not no hs-falsy? and or = + hs-add - * / "%" modulo empty? hs-empty? exists? nil? matches? hs-matches? contains? hs-contains? as hs-coerce in? of first last "!=" "<" < ">" > "<=" <= ">=" >= closest dom-closest next hs-next previous hs-previous hs-query-last add-class for-each _el dom-add-class hs-query-all multi-add-class do {:upvalue-count 1 :arity 1 :constants ("list" dom-add-class) :bytecode (1 1 0 18 0 16 0 52 0 0 3 50)} multi-remove-class {:upvalue-count 1 :arity 1 :constants ("list" dom-remove-class) :bytecode (1 1 0 18 0 16 0 52 0 0 3 50)} remove-class dom-remove-class toggle-class hs-toggle-class! toggle-between hs-toggle-between! toggle-style hs-toggle-style! toggle-style-between hs-toggle-style-between! 4 toggle-attr hs-toggle-attr! toggle-attr-between hs-toggle-attr-between! set! put! hs-put! if when wait hs-wait wait-for log console-log send trigger dom-dispatch hide "display" "opacity" dom-set-style "0" "visibility" "hidden" "none" show "1" "visible" transition repeat fetch hs-fetch call return throw raise settle hs-settle go hs-navigate! append! dom-append tell let for take! hs-take! make install hs-install measure hs-measure increment! decrement! on init hs-init def define behavior sx-eval "sx-parse" cek-eval component render {:upvalue-count 1 :arity 1 :constants ("<" "len" 2 "list" "cons" "make-keyword" "first" "hs-to-sx" "nth" 1 "rest") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 7 0 52 3 0 0 32 46 0 16 0 52 6 0 1 52 5 0 1 20 7 0 16 0 1 9 0 52 8 0 2 48 1 18 0 16 0 52 10 0 1 52 10 0 1 48 1 52 4 0 2 52 4 0 2 50)} render-to-html not-in? type-check hs-type-check type-check-strict hs-type-check-strict strict-eq hs-strict-eq some every every? scroll! hs-scroll! select! hs-select! reset! hs-reset! default! halt! hs-halt!) :bytecode (16 0 52 0 0 1 33 4 0 2 32 88 24 16 0 52 1 0 1 33 5 0 16 0 32 74 24 16 0 52 2 0 1 33 5 0 16 0 32 60 24 16 0 52 3 0 1 33 5 0 16 0 32 46 24 16 0 52 5 0 1 52 4 0 1 33 5 0 16 0 32 28 24 16 0 52 6 0 1 17 1 16 1 1 8 0 52 7 0 2 33 4 0 2 32 4 24 16 1 1 9 0 52 7 0 2 33 67 0 16 0 1 11 0 52 10 0 2 17 2 16 2 52 12 0 1 1 13 0 52 7 0 2 33 10 0 1 15 0 52 14 0 1 32 27 0 1 17 0 1 18 0 51 20 0 16 2 52 19 0 2 52 16 0 2 52 14 0 1 52 16 0 2 32 181 23 16 1 1 21 0 52 7 0 2 33 115 0 16 0 1 11 0 52 10 0 2 17 2 52 14 0 0 17 3 1 22 0 17 4 1 13 0 17 5 16 2 52 12 0 1 17 6 51 23 0 1 4 1 3 17 7 5 51 24 0 1 6 1 2 1 8 17 8 5 51 25 0 1 6 1 2 1 9 17 9 5 51 26 0 1 5 1 6 1 2 1 9 1 7 1 3 1 10 1 8 1 4 17 10 5 16 10 48 0 5 16 7 48 0 5 1 27 0 16 3 52 16 0 2 32 54 23 16 1 1 28 0 52 7 0 2 33 24 0 1 29 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 18 23 16 1 1 31 0 52 7 0 2 33 38 0 1 32 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 224 22 16 1 1 34 0 52 7 0 2 33 52 0 1 35 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 4 32 160 22 16 1 1 37 0 52 7 0 2 33 33 0 1 38 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 115 22 16 1 1 39 0 52 7 0 2 33 52 0 1 40 0 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 51 22 16 1 1 43 0 52 7 0 2 33 52 0 1 44 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 52 14 0 3 32 243 21 16 1 1 45 0 52 7 0 2 33 52 0 1 46 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 52 14 0 3 32 179 21 16 1 1 47 0 52 7 0 2 33 52 0 1 48 0 1 41 0 1 42 0 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 115 21 16 1 1 49 0 52 7 0 2 33 38 0 1 50 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 65 21 16 1 1 51 0 52 7 0 2 33 38 0 1 52 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 15 21 16 1 1 53 0 52 7 0 2 33 134 0 16 0 1 11 0 52 10 0 2 17 2 20 30 0 16 0 1 33 0 52 10 0 2 52 19 0 2 17 3 16 2 52 5 0 1 6 33 18 0 5 16 2 52 6 0 1 1 55 0 52 54 0 1 52 7 0 2 33 51 0 20 30 0 16 2 1 11 0 52 10 0 2 48 1 17 4 16 2 1 33 0 52 10 0 2 17 5 1 56 0 16 4 16 5 16 3 52 16 0 2 52 16 0 2 52 16 0 2 32 20 0 1 56 0 20 30 0 16 2 48 1 16 3 52 16 0 2 52 16 0 2 32 125 20 16 1 1 57 0 52 7 0 2 33 33 0 1 27 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 80 20 16 1 1 58 0 52 7 0 2 33 69 0 20 54 0 16 0 1 11 0 52 10 0 2 52 19 0 2 17 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 17 3 16 2 52 12 0 1 1 13 0 52 7 0 2 33 5 0 16 3 32 11 0 1 41 0 16 2 16 3 52 14 0 3 32 255 19 16 1 1 59 0 52 7 0 2 33 6 0 1 59 0 32 237 19 16 1 1 42 0 52 7 0 2 33 6 0 1 42 0 32 219 19 16 1 1 60 0 52 7 0 2 33 6 0 1 60 0 32 201 19 16 1 18 0 52 7 0 2 33 89 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 1 33 0 52 10 0 2 17 3 16 3 1 6 0 52 7 0 2 33 12 0 1 61 0 16 2 52 14 0 2 32 35 0 16 3 1 62 0 52 7 0 2 33 12 0 1 63 0 16 2 52 14 0 2 32 11 0 1 64 0 16 2 16 3 52 14 0 3 32 101 19 16 1 1 65 0 52 7 0 2 33 16 0 16 0 1 11 0 52 10 0 2 52 54 0 1 32 73 19 16 1 1 66 0 52 7 0 2 33 19 0 1 67 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 42 19 16 1 1 68 0 52 7 0 2 33 33 0 1 69 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 253 18 16 1 1 70 0 52 7 0 2 33 33 0 1 71 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 208 18 16 1 1 72 0 52 7 0 2 33 16 0 16 0 1 11 0 52 10 0 2 52 54 0 1 32 180 18 16 1 1 73 0 52 7 0 2 33 23 0 1 18 0 20 30 0 16 0 52 74 0 1 52 19 0 2 52 16 0 2 32 145 18 16 1 1 75 0 52 7 0 2 33 24 0 1 75 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 109 18 16 1 1 76 0 52 7 0 2 33 24 0 1 77 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 73 18 16 1 1 78 0 52 7 0 2 33 38 0 1 78 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 23 18 16 1 1 79 0 52 7 0 2 33 38 0 1 79 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 229 17 16 1 1 80 0 52 7 0 2 33 38 0 1 80 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 179 17 16 1 1 81 0 52 7 0 2 33 38 0 1 82 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 129 17 16 1 1 83 0 52 7 0 2 33 38 0 1 83 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 79 17 16 1 1 84 0 52 7 0 2 33 38 0 1 84 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 29 17 16 1 1 85 0 52 7 0 2 33 38 0 1 85 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 235 16 16 1 18 1 52 7 0 2 33 81 0 16 0 1 33 0 52 10 0 2 52 0 0 1 33 27 0 1 27 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 1 86 0 52 14 0 3 32 35 0 1 87 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 143 16 16 1 1 88 0 52 7 0 2 33 24 0 1 89 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 107 16 16 1 1 90 0 52 7 0 2 33 31 0 1 75 0 1 91 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 52 14 0 2 32 64 16 16 1 1 92 0 52 7 0 2 33 38 0 1 93 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 14 16 16 1 1 94 0 52 7 0 2 33 38 0 1 95 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 220 15 16 1 1 96 0 52 7 0 2 33 33 0 1 97 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 175 15 16 1 1 98 0 52 7 0 2 33 38 0 1 95 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 125 15 16 1 1 99 0 52 7 0 2 33 94 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 17 3 16 2 1 100 0 52 7 0 2 33 12 0 1 100 0 16 3 52 14 0 2 32 35 0 16 2 1 101 0 52 7 0 2 33 12 0 1 101 0 16 3 52 14 0 2 32 11 0 1 64 0 16 3 16 2 52 14 0 3 32 19 15 16 1 1 102 0 52 7 0 2 33 45 0 1 75 0 1 80 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 52 14 0 2 32 218 14 16 1 1 103 0 52 7 0 2 33 38 0 1 104 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 168 14 16 1 1 105 0 52 7 0 2 33 38 0 1 106 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 118 14 16 1 1 107 0 52 7 0 2 33 38 0 1 108 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 68 14 16 1 1 109 0 52 7 0 2 33 38 0 1 110 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 18 14 16 1 1 111 0 52 7 0 2 33 33 0 1 112 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 229 13 16 1 1 113 0 52 7 0 2 33 33 0 1 114 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 184 13 16 1 1 115 0 52 7 0 2 33 33 0 1 116 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 139 13 16 1 1 100 0 52 7 0 2 33 68 0 16 0 52 12 0 1 1 33 0 52 105 0 2 33 33 0 1 61 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 16 0 1 67 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 59 13 16 1 1 101 0 52 7 0 2 33 68 0 16 0 52 12 0 1 1 33 0 52 105 0 2 33 33 0 1 63 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 16 0 1 117 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 235 12 16 1 1 118 0 52 7 0 2 33 123 0 16 0 1 33 0 52 10 0 2 17 2 16 2 52 5 0 1 6 33 14 0 5 16 2 52 6 0 1 1 66 0 52 7 0 2 33 59 0 1 119 0 1 41 0 1 120 0 52 14 0 1 1 121 0 1 120 0 16 0 1 11 0 52 10 0 2 52 14 0 3 52 14 0 3 1 122 0 16 2 1 11 0 52 10 0 2 52 14 0 2 52 14 0 3 32 23 0 1 121 0 20 30 0 16 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 100 12 16 1 1 123 0 52 7 0 2 33 49 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 74 0 1 52 74 0 1 17 3 1 124 0 51 125 0 1 2 16 3 52 19 0 2 52 16 0 2 32 39 12 16 1 1 126 0 52 7 0 2 33 49 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 74 0 1 52 74 0 1 17 3 1 124 0 51 127 0 1 2 16 3 52 19 0 2 52 16 0 2 32 234 11 16 1 1 128 0 52 7 0 2 33 123 0 16 0 1 33 0 52 10 0 2 17 2 16 2 52 5 0 1 6 33 14 0 5 16 2 52 6 0 1 1 66 0 52 7 0 2 33 59 0 1 119 0 1 41 0 1 120 0 52 14 0 1 1 129 0 1 120 0 16 0 1 11 0 52 10 0 2 52 14 0 3 52 14 0 3 1 122 0 16 2 1 11 0 52 10 0 2 52 14 0 2 52 14 0 3 32 23 0 1 129 0 20 30 0 16 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 99 11 16 1 1 130 0 52 7 0 2 33 33 0 1 131 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 54 11 16 1 1 132 0 52 7 0 2 33 42 0 1 133 0 20 30 0 16 0 1 36 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 16 0 1 33 0 52 10 0 2 52 14 0 4 32 0 11 16 1 1 134 0 52 7 0 2 33 33 0 1 135 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 211 10 16 1 1 136 0 52 7 0 2 33 61 0 1 137 0 20 30 0 16 0 1 138 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 5 32 138 10 16 1 1 139 0 52 7 0 2 33 33 0 1 140 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 52 14 0 3 32 93 10 16 1 1 141 0 52 7 0 2 33 61 0 1 142 0 20 30 0 16 0 1 138 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 5 32 20 10 16 1 1 143 0 52 7 0 2 33 30 0 18 2 16 0 1 11 0 52 10 0 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 49 2 32 234 9 16 1 1 144 0 52 7 0 2 33 47 0 1 145 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 4 32 175 9 16 1 1 146 0 52 7 0 2 33 106 0 16 0 52 12 0 1 1 36 0 52 105 0 2 33 52 0 1 146 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 4 32 35 0 1 147 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 57 9 16 1 1 124 0 52 7 0 2 33 23 0 1 124 0 20 30 0 16 0 52 74 0 1 52 19 0 2 52 16 0 2 32 22 9 16 1 1 148 0 52 7 0 2 33 19 0 1 149 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 247 8 16 1 1 150 0 52 7 0 2 33 9 0 18 3 16 0 49 1 32 226 8 16 1 1 151 0 52 7 0 2 33 24 0 1 152 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 190 8 16 1 1 153 0 52 7 0 2 33 9 0 18 4 16 0 49 1 32 169 8 16 1 1 154 0 52 7 0 2 33 34 0 1 155 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 16 0 1 11 0 52 10 0 2 2 52 14 0 4 32 123 8 16 1 1 156 0 52 7 0 2 33 127 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 12 0 1 1 33 0 52 105 0 2 33 12 0 16 0 1 33 0 52 10 0 2 32 3 0 1 157 0 17 3 16 3 1 158 0 52 7 0 2 33 18 0 1 159 0 16 2 1 158 0 1 160 0 52 14 0 4 32 45 0 16 3 1 161 0 52 7 0 2 33 18 0 1 159 0 16 2 1 161 0 1 162 0 52 14 0 4 32 15 0 1 159 0 16 2 1 157 0 1 163 0 52 14 0 4 32 240 7 16 1 1 164 0 52 7 0 2 33 127 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 16 0 52 12 0 1 1 33 0 52 105 0 2 33 12 0 16 0 1 33 0 52 10 0 2 32 3 0 1 157 0 17 3 16 3 1 158 0 52 7 0 2 33 18 0 1 159 0 16 2 1 158 0 1 165 0 52 14 0 4 32 45 0 16 3 1 161 0 52 7 0 2 33 18 0 1 159 0 16 2 1 161 0 1 166 0 52 14 0 4 32 15 0 1 159 0 16 2 1 157 0 1 22 0 52 14 0 4 32 101 7 16 1 1 167 0 52 7 0 2 33 9 0 18 5 16 0 49 1 32 80 7 16 1 1 168 0 52 7 0 2 33 9 0 18 6 16 0 49 1 32 59 7 16 1 1 169 0 52 7 0 2 33 33 0 1 170 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 14 7 16 1 1 171 0 52 7 0 2 33 45 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 20 30 0 16 0 1 33 0 52 10 0 2 52 19 0 2 17 3 16 2 16 3 52 16 0 2 32 213 6 16 1 1 172 0 52 7 0 2 33 17 0 20 30 0 16 0 1 11 0 52 10 0 2 49 1 32 184 6 16 1 1 173 0 52 7 0 2 33 24 0 1 174 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 148 6 16 1 1 175 0 52 7 0 2 33 13 0 1 176 0 1 59 0 52 14 0 2 32 123 6 16 1 1 177 0 52 7 0 2 33 24 0 1 178 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 87 6 16 1 1 179 0 52 7 0 2 33 38 0 1 180 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 37 6 16 1 1 181 0 52 7 0 2 33 49 0 1 182 0 1 59 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 52 14 0 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 232 5 16 1 1 183 0 52 7 0 2 33 9 0 18 7 16 0 49 1 32 211 5 16 1 1 184 0 52 7 0 2 33 190 0 16 0 1 11 0 52 10 0 2 17 2 16 0 1 33 0 52 10 0 2 17 3 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 17 4 16 0 52 12 0 1 1 138 0 52 105 0 2 33 12 0 16 0 1 138 0 52 10 0 2 32 1 0 2 17 5 16 5 33 10 0 20 30 0 16 5 48 1 32 3 0 1 59 0 17 6 16 4 52 0 0 1 33 4 0 2 32 53 0 16 4 52 5 0 1 6 33 14 0 5 16 4 52 6 0 1 1 66 0 52 7 0 2 33 19 0 1 122 0 16 4 1 11 0 52 10 0 2 52 14 0 2 32 7 0 20 30 0 16 4 48 1 17 7 1 185 0 16 6 16 2 16 3 16 7 52 14 0 5 32 9 5 16 1 1 186 0 52 7 0 2 33 9 0 18 8 16 0 49 1 32 244 4 16 1 1 187 0 52 7 0 2 33 23 0 1 188 0 20 30 0 16 0 52 74 0 1 52 19 0 2 52 16 0 2 32 209 4 16 1 1 189 0 52 7 0 2 33 24 0 1 190 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 173 4 16 1 1 191 0 52 7 0 2 33 54 0 18 9 16 0 1 11 0 52 10 0 2 16 0 1 33 0 52 10 0 2 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 49 3 32 107 4 16 1 1 192 0 52 7 0 2 33 54 0 18 10 16 0 1 11 0 52 10 0 2 16 0 1 33 0 52 10 0 2 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 49 3 32 41 4 16 1 1 193 0 52 7 0 2 33 9 0 18 11 16 0 49 1 32 20 4 16 1 1 194 0 52 7 0 2 33 35 0 1 195 0 1 41 0 52 14 0 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 52 14 0 2 32 229 3 16 1 1 196 0 52 7 0 2 33 60 0 1 197 0 16 0 1 11 0 52 10 0 2 52 54 0 1 1 41 0 20 54 0 16 0 1 33 0 52 10 0 2 52 19 0 2 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 3 52 14 0 3 32 157 3 16 1 1 198 0 52 7 0 2 33 9 0 18 12 16 0 49 1 32 136 3 16 1 1 199 0 52 7 0 2 33 51 0 16 0 1 11 0 52 10 0 2 17 2 16 2 52 2 0 1 33 14 0 20 200 0 16 2 48 1 52 6 0 1 32 14 0 1 201 0 20 30 0 16 2 48 1 52 14 0 2 32 73 3 16 1 1 202 0 52 7 0 2 33 16 0 16 0 1 11 0 52 10 0 2 52 54 0 1 32 45 3 16 1 1 203 0 52 7 0 2 33 182 0 16 0 1 11 0 52 10 0 2 17 2 16 0 1 33 0 52 10 0 2 17 3 16 0 52 12 0 1 1 36 0 52 105 0 2 33 12 0 16 0 1 36 0 52 10 0 2 32 1 0 2 17 4 16 0 52 12 0 1 1 138 0 52 105 0 2 33 17 0 20 30 0 16 0 1 138 0 52 10 0 2 48 1 32 1 0 2 17 5 16 2 52 2 0 1 33 9 0 16 2 52 54 0 1 32 7 0 20 30 0 16 2 48 1 17 6 51 204 0 1 7 17 7 5 1 205 0 16 6 16 7 16 3 48 1 52 16 0 2 52 16 0 2 17 8 16 4 33 27 0 1 145 0 16 8 16 4 16 5 33 5 0 16 5 32 3 0 1 59 0 52 14 0 4 32 2 0 16 8 32 107 2 16 1 1 206 0 52 7 0 2 33 45 0 1 75 0 1 95 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 52 14 0 2 32 50 2 16 1 1 98 0 52 7 0 2 33 38 0 1 95 0 20 30 0 16 0 1 33 0 52 10 0 2 48 1 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 3 32 0 2 16 1 1 207 0 52 7 0 2 33 33 0 1 208 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 211 1 16 1 1 209 0 52 7 0 2 33 33 0 1 210 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 166 1 16 1 1 211 0 52 7 0 2 33 38 0 1 212 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 116 1 16 1 1 213 0 52 7 0 2 33 62 0 1 213 0 1 41 0 16 0 1 11 0 52 10 0 2 52 54 0 1 52 14 0 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 42 1 16 1 1 214 0 52 7 0 2 33 62 0 1 215 0 1 41 0 16 0 1 11 0 52 10 0 2 52 54 0 1 52 14 0 1 20 30 0 16 0 1 36 0 52 10 0 2 48 1 52 14 0 3 20 30 0 16 0 1 33 0 52 10 0 2 48 1 52 14 0 3 32 224 0 16 1 1 216 0 52 7 0 2 33 33 0 1 217 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 16 0 1 33 0 52 10 0 2 52 14 0 3 32 179 0 16 1 1 218 0 52 7 0 2 33 24 0 1 219 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 143 0 16 1 1 220 0 52 7 0 2 33 24 0 1 221 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 52 14 0 2 32 107 0 16 1 1 222 0 52 7 0 2 33 62 0 20 30 0 16 0 1 11 0 52 10 0 2 48 1 17 2 20 30 0 16 0 1 33 0 52 10 0 2 48 1 17 3 1 147 0 1 91 0 16 2 52 14 0 2 1 143 0 16 2 16 3 52 14 0 3 52 14 0 3 32 33 0 16 1 1 223 0 52 7 0 2 33 19 0 1 224 0 16 0 1 11 0 52 10 0 2 52 14 0 2 32 2 0 16 0 50)} "hs-to-sx-from-source" {:upvalue-count 0 :arity 1 :constants ("hs-to-sx" "hs-compile") :bytecode (20 0 0 20 1 0 16 0 48 1 49 1 50)}) :bytecode (1 2 0 52 1 0 1 17 0 1 3 0 52 1 0 1 17 1 51 4 0 17 2 5 51 5 0 1 0 17 3 5 51 6 0 17 4 5 51 7 0 17 5 5 51 8 0 17 6 5 51 9 0 17 7 5 51 10 0 17 8 5 51 11 0 17 9 5 51 12 0 17 10 5 51 13 0 1 0 17 11 5 51 14 0 1 0 17 12 5 51 15 0 17 13 5 51 16 0 1 0 1 1 1 3 1 8 1 5 1 9 1 6 1 7 1 10 1 11 1 12 1 4 1 13 128 0 0 5 51 18 0 128 17 0 50))) diff --git a/shared/static/wasm/sx/hs-runtime.sx b/shared/static/wasm/sx/hs-runtime.sx index 334de332..bca2bfd7 100644 --- a/shared/static/wasm/sx/hs-runtime.sx +++ b/shared/static/wasm/sx/hs-runtime.sx @@ -13,45 +13,53 @@ ;; Register an event listener. Returns unlisten function. ;; (hs-on target event-name handler) → unlisten-fn (define - hs-on - (fn (target event-name handler) (dom-listen target event-name handler))) + hs-each + (fn + (target action) + (if (list? target) (for-each action target) (action target)))) ;; Register for every occurrence (no queuing — each fires independently). ;; Stock hyperscript queues by default; "every" disables queuing. (define - hs-on-every + hs-on (fn (target event-name handler) (dom-listen target event-name handler))) ;; Run an initializer function immediately. ;; (hs-init thunk) — called at element boot time -(define hs-init (fn (thunk) (thunk))) +(define + hs-on-every + (fn (target event-name handler) (dom-listen target event-name handler))) ;; ── Async / timing ────────────────────────────────────────────── ;; Wait for a duration in milliseconds. ;; In hyperscript, wait is async-transparent — execution pauses. ;; Here we use perform/IO suspension for true pause semantics. -(define hs-wait (fn (ms) (perform (list (quote io-sleep) ms)))) +(define hs-init (fn (thunk) (thunk))) ;; Wait for a DOM event on a target. ;; (hs-wait-for target event-name) — suspends until event fires +(define hs-wait (fn (ms) (perform (list (quote io-sleep) ms)))) + +;; Wait for CSS transitions/animations to settle on an element. (define hs-wait-for (fn (target event-name) (perform (list (quote io-wait-event) target event-name)))) -;; Wait for CSS transitions/animations to settle on an element. -(define hs-settle (fn (target) (perform (list (quote io-settle) target)))) - ;; ── Class manipulation ────────────────────────────────────────── ;; Toggle a single class on an element. +(define hs-settle (fn (target) (perform (list (quote io-settle) target)))) + +;; Toggle between two classes — exactly one is active at a time. (define hs-toggle-class! (fn (target cls) (host-call (host-get target "classList") "toggle" cls))) -;; Toggle between two classes — exactly one is active at a time. +;; Take a class from siblings — add to target, remove from others. +;; (hs-take! target cls) — like radio button class behavior (define hs-toggle-between! (fn @@ -61,8 +69,10 @@ (do (dom-remove-class target cls1) (dom-add-class target cls2)) (do (dom-remove-class target cls2) (dom-add-class target cls1))))) -;; Take a class from siblings — add to target, remove from others. -;; (hs-take! target cls) — like radio button class behavior +;; ── DOM insertion ─────────────────────────────────────────────── + +;; Put content at a position relative to a target. +;; pos: "into" | "before" | "after" (define hs-toggle-style! (fn @@ -86,10 +96,9 @@ (dom-set-style target prop "hidden") (dom-set-style target prop ""))))))) -;; ── DOM insertion ─────────────────────────────────────────────── +;; ── Navigation / traversal ────────────────────────────────────── -;; Put content at a position relative to a target. -;; pos: "into" | "before" | "after" +;; Navigate to a URL. (define hs-take! (fn @@ -105,9 +114,7 @@ (for-each (fn (el) (dom-remove-attr el name)) els) (dom-set-attr target name "true")))))) -;; ── Navigation / traversal ────────────────────────────────────── - -;; Navigate to a URL. +;; Find next sibling matching a selector (or any sibling). (define hs-put! (fn @@ -120,10 +127,10 @@ ((= pos "start") (dom-insert-adjacent-html target "afterbegin" value)) ((= pos "end") (dom-insert-adjacent-html target "beforeend" value))))) -;; Find next sibling matching a selector (or any sibling). +;; Find previous sibling matching a selector. (define hs-navigate! (fn (url) (perform (list (quote io-navigate) url)))) -;; Find previous sibling matching a selector. +;; First element matching selector within a scope. (define hs-scroll! (fn @@ -136,7 +143,7 @@ ((= position "bottom") (dict :block "end")) (true (dict :block "start"))))))) -;; First element matching selector within a scope. +;; Last element matching selector. (define hs-halt! (fn @@ -146,12 +153,14 @@ (host-call event "preventDefault" (list)) (when (= mode "event") (host-call event "stopPropagation" (list)))))) -;; Last element matching selector. +;; First/last within a specific scope. (define hs-select! (fn (target) (host-call target "select" (list)))) -;; First/last within a specific scope. (define hs-reset! (fn (target) (host-call target "reset" (list)))) +;; ── Iteration ─────────────────────────────────────────────────── + +;; Repeat a thunk N times. (define hs-next (fn @@ -171,9 +180,7 @@ (true (find-next (dom-next-sibling el)))))) (find-next sibling))))) -;; ── Iteration ─────────────────────────────────────────────────── - -;; Repeat a thunk N times. +;; Repeat forever (until break — relies on exception/continuation). (define hs-previous (fn @@ -193,27 +200,24 @@ (true (find-prev (dom-get-prop el "previousElementSibling")))))) (find-prev sibling))))) -;; Repeat forever (until break — relies on exception/continuation). -(define - hs-query-all - (fn - (sel) - (dom-query-all - (host-call (host-global "document") "querySelector" (list "body")) - sel))) - ;; ── Fetch ─────────────────────────────────────────────────────── ;; Fetch a URL, parse response according to format. ;; (hs-fetch url format) — format is "json" | "text" | "html" -(define - hs-query-first - (fn (sel) (host-call (host-global "document") "querySelector" sel))) +(define hs-query-all (fn (sel) (dom-query-all (dom-body) sel))) ;; ── Type coercion ─────────────────────────────────────────────── ;; Coerce a value to a type by name. ;; (hs-coerce value type-name) — type-name is "Int", "Float", "String", etc. +(define + hs-query-first + (fn (sel) (host-call (host-global "document") "querySelector" sel))) + +;; ── Object creation ───────────────────────────────────────────── + +;; Make a new object of a given type. +;; (hs-make type-name) — creates empty object/collection (define hs-query-last (fn @@ -222,17 +226,17 @@ ((all (dom-query-all (dom-body) sel))) (if (> (len all) 0) (nth all (- (len all) 1)) nil)))) -;; ── Object creation ───────────────────────────────────────────── - -;; Make a new object of a given type. -;; (hs-make type-name) — creates empty object/collection -(define hs-first (fn (scope sel) (dom-query-all scope sel))) - ;; ── Behavior installation ─────────────────────────────────────── ;; Install a behavior on an element. ;; A behavior is a function that takes (me ...params) and sets up features. ;; (hs-install behavior-fn me ...args) +(define hs-first (fn (scope sel) (dom-query-all scope sel))) + +;; ── Measurement ───────────────────────────────────────────────── + +;; Measure an element's bounding rect, store as local variables. +;; Returns a dict with x, y, width, height, top, left, right, bottom. (define hs-last (fn @@ -241,10 +245,10 @@ ((all (dom-query-all scope sel))) (if (> (len all) 0) (nth all (- (len all) 1)) nil)))) -;; ── Measurement ───────────────────────────────────────────────── +;; ── Transition ────────────────────────────────────────────────── -;; Measure an element's bounding rect, store as local variables. -;; Returns a dict with x, y, width, height, top, left, right, bottom. +;; Transition a CSS property to a value, optionally with duration. +;; (hs-transition target prop value duration) (define hs-repeat-times (fn @@ -254,10 +258,6 @@ (fn (i) (when (< i n) (do (thunk) (do-repeat (+ i 1)))))) (do-repeat 0))) -;; ── Transition ────────────────────────────────────────────────── - -;; Transition a CSS property to a value, optionally with duration. -;; (hs-transition target prop value duration) (define hs-repeat-forever (fn @@ -365,14 +365,14 @@ (value type-name) (if (nil? value) false (hs-type-check value type-name)))) + + + + (define hs-strict-eq (fn (a b) (and (= (type-of a) (type-of b)) (= a b)))) - - - - (define hs-falsy? (fn @@ -384,7 +384,8 @@ ((and (list? v) (= (len v) 0)) true) ((= v 0) true) (true false)))) - +;; ── Sandbox/test runtime additions ────────────────────────────── +;; Property access — dot notation and .length (define hs-matches? (fn @@ -393,8 +394,7 @@ (string? target) (if (= pattern ".*") true (string-contains? target pattern)) false))) -;; ── Sandbox/test runtime additions ────────────────────────────── -;; Property access — dot notation and .length +;; DOM query stub — sandbox returns empty list (define hs-contains? (fn @@ -414,7 +414,7 @@ true (hs-contains? (rest collection) item))))) (true false)))) -;; DOM query stub — sandbox returns empty list +;; Method dispatch — obj.method(args) (define hs-empty? (fn @@ -425,13 +425,13 @@ ((list? v) (= (len v) 0)) ((dict? v) (= (len (keys v)) 0)) (true false)))) -;; Method dispatch — obj.method(args) -(define hs-first (fn (lst) (first lst))) ;; ── 0.9.90 features ───────────────────────────────────────────── ;; beep! — debug logging, returns value unchanged -(define hs-last (fn (lst) (last lst))) +(define hs-first (fn (lst) (first lst))) ;; Property-based is — check obj.key truthiness +(define hs-last (fn (lst) (last lst))) +;; Array slicing (inclusive both ends) (define hs-template (fn @@ -517,7 +517,7 @@ (set! i (+ i 1)) (tpl-loop))))))) (do (tpl-loop) result)))) -;; Array slicing (inclusive both ends) +;; Collection: sorted by (define hs-make-object (fn @@ -529,7 +529,7 @@ (fn (pair) (dict-set! d (first pair) (nth pair 1))) pairs) d)))) -;; Collection: sorted by +;; Collection: sorted by descending (define hs-method-call (fn @@ -552,11 +552,11 @@ (if (= (first lst) item) i (idx-loop (rest lst) (+ i 1)))))) (idx-loop obj 0))) (true nil)))) -;; Collection: sorted by descending -(define hs-beep (fn (v) v)) ;; Collection: split by -(define hs-prop-is (fn (obj key) (not (hs-falsy? (host-get obj key))))) +(define hs-beep (fn (v) v)) ;; Collection: joined by +(define hs-prop-is (fn (obj key) (not (hs-falsy? (host-get obj key))))) + (define hs-slice (fn diff --git a/shared/static/wasm/sx/hs-runtime.sxbc b/shared/static/wasm/sx/hs-runtime.sxbc index 0b832785..6b0e3087 100644 --- a/shared/static/wasm/sx/hs-runtime.sxbc +++ b/shared/static/wasm/sx/hs-runtime.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "a626ec2f79d7ef8c" +(sxbc 1 "7770eb263eb7477d" (code - :constants ("hs-on" {:upvalue-count 0 :arity 3 :constants ("dom-listen") :bytecode (20 0 0 16 0 16 1 16 2 49 3 50)} "hs-on-every" "hs-init" {:upvalue-count 0 :arity 1 :constants () :bytecode (16 0 49 0 50)} "hs-wait" {:upvalue-count 0 :arity 1 :constants ("list" io-sleep) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-wait-for" {:upvalue-count 0 :arity 2 :constants ("list" io-wait-event) :bytecode (1 1 0 16 0 16 1 52 0 0 3 112 50)} "hs-settle" {:upvalue-count 0 :arity 1 :constants ("list" io-settle) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-toggle-class!" {:upvalue-count 0 :arity 2 :constants ("host-call" "host-get" "classList" "toggle") :bytecode (20 0 0 20 1 0 16 0 1 2 0 48 2 1 3 0 16 1 49 3 50)} "hs-toggle-between!" {:upvalue-count 0 :arity 3 :constants ("dom-has-class?" "dom-remove-class" "dom-add-class") :bytecode (20 0 0 16 0 16 1 48 2 33 22 0 20 1 0 16 0 16 1 48 2 5 20 2 0 16 0 16 2 49 2 32 19 0 20 1 0 16 0 16 2 48 2 5 20 2 0 16 0 16 1 49 2 50)} "hs-toggle-style!" {:upvalue-count 0 :arity 2 :constants ("dom-get-style" "=" "visibility" "hidden" "dom-set-style" "visible" "display" "opacity" "none" "0" "") :bytecode (20 0 0 16 0 16 1 48 2 17 2 16 1 1 2 0 52 1 0 2 33 42 0 16 2 1 3 0 52 1 0 2 33 15 0 20 4 0 16 0 16 1 1 5 0 49 3 32 12 0 20 4 0 16 0 16 1 1 3 0 49 3 32 151 0 16 1 1 6 0 52 1 0 2 6 34 10 0 5 16 1 1 7 0 52 1 0 2 33 74 0 16 2 1 8 0 52 1 0 2 6 34 10 0 5 16 2 1 9 0 52 1 0 2 33 15 0 20 4 0 16 0 16 1 1 10 0 49 3 32 30 0 20 4 0 16 0 16 1 16 1 1 6 0 52 1 0 2 33 6 0 1 8 0 32 3 0 1 9 0 49 3 32 51 0 16 2 1 10 0 52 1 0 2 6 34 8 0 5 16 2 2 52 1 0 2 33 15 0 20 4 0 16 0 16 1 1 3 0 49 3 32 12 0 20 4 0 16 0 16 1 1 10 0 49 3 50)} "hs-take!" {:upvalue-count 0 :arity 4 :constants ("list?" "list" "host-get" "parentNode" "dom-child-list" "=" "class" "for-each" {:upvalue-count 1 :arity 1 :constants ("dom-remove-class") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dom-add-class" {:upvalue-count 1 :arity 1 :constants ("dom-remove-attr") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dom-set-attr" "true") :bytecode (16 3 33 23 0 16 3 52 0 0 1 33 5 0 16 3 32 6 0 16 3 52 1 0 1 32 31 0 20 2 0 16 0 1 3 0 48 2 17 4 16 4 33 10 0 20 4 0 16 4 48 1 32 4 0 52 1 0 0 17 4 16 1 1 6 0 52 5 0 2 33 24 0 51 8 0 1 2 16 4 52 7 0 2 5 20 9 0 16 0 16 2 49 2 32 24 0 51 10 0 1 2 16 4 52 7 0 2 5 20 11 0 16 0 16 2 1 12 0 49 3 50)} "hs-put!" {:upvalue-count 0 :arity 3 :constants ("=" "into" "dom-set-inner-html" "before" "dom-insert-adjacent-html" "beforebegin" "after" "afterend" "start" "afterbegin" "end" "beforeend") :bytecode (16 1 1 1 0 52 0 0 2 33 12 0 20 2 0 16 2 16 0 49 2 32 109 0 16 1 1 3 0 52 0 0 2 33 15 0 20 4 0 16 2 1 5 0 16 0 49 3 32 82 0 16 1 1 6 0 52 0 0 2 33 15 0 20 4 0 16 2 1 7 0 16 0 49 3 32 55 0 16 1 1 8 0 52 0 0 2 33 15 0 20 4 0 16 2 1 9 0 16 0 49 3 32 28 0 16 1 1 10 0 52 0 0 2 33 15 0 20 4 0 16 2 1 11 0 16 0 49 3 32 1 0 2 50)} "hs-navigate!" {:upvalue-count 0 :arity 1 :constants ("list" io-navigate) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-scroll!" {:upvalue-count 0 :arity 2 :constants ("host-call" "scrollIntoView" "list" "=" "bottom" "dict" "block" "end" "start") :bytecode (20 0 0 16 0 1 1 0 16 1 1 4 0 52 3 0 2 33 13 0 1 6 0 1 7 0 52 5 0 2 32 10 0 1 6 0 1 8 0 52 5 0 2 52 2 0 1 49 3 50)} "hs-halt!" {:upvalue-count 0 :arity 1 :constants ("event" "host-call" "preventDefault" "list" "=" "stopPropagation") :bytecode (20 0 0 33 50 0 20 1 0 20 0 0 1 2 0 52 3 0 0 48 3 5 16 0 1 0 0 52 4 0 2 33 18 0 20 1 0 20 0 0 1 5 0 52 3 0 0 49 3 32 1 0 2 32 1 0 2 50)} "hs-select!" {:upvalue-count 0 :arity 1 :constants ("host-call" "select" "list") :bytecode (20 0 0 16 0 1 1 0 52 2 0 0 49 3 50)} "hs-reset!" {:upvalue-count 0 :arity 1 :constants ("host-call" "reset" "list") :bytecode (20 0 0 16 0 1 1 0 52 2 0 0 49 3 50)} "hs-next" {:upvalue-count 0 :arity 2 :constants ("=" "*" "dom-next-sibling" {:upvalue-count 2 :arity 1 :constants ("nil?" "dom-matches?" "dom-next-sibling") :bytecode (16 0 52 0 0 1 33 4 0 2 32 28 0 20 1 0 16 0 18 0 48 2 33 5 0 16 0 32 11 0 18 1 20 2 0 16 0 48 1 49 1 50)}) :bytecode (16 1 1 1 0 52 0 0 2 33 10 0 20 2 0 16 0 49 1 32 25 0 20 2 0 16 0 48 1 17 2 51 3 0 1 1 1 3 17 3 5 16 3 16 2 49 1 50)} "hs-previous" {:upvalue-count 0 :arity 2 :constants ("=" "*" "dom-get-prop" "previousElementSibling" {:upvalue-count 2 :arity 1 :constants ("nil?" "dom-matches?" "dom-get-prop" "previousElementSibling") :bytecode (16 0 52 0 0 1 33 4 0 2 32 31 0 20 1 0 16 0 18 0 48 2 33 5 0 16 0 32 14 0 18 1 20 2 0 16 0 1 3 0 48 2 49 1 50)}) :bytecode (16 1 1 1 0 52 0 0 2 33 13 0 20 2 0 16 0 1 3 0 49 2 32 28 0 20 2 0 16 0 1 3 0 48 2 17 2 51 4 0 1 1 1 3 17 3 5 16 3 16 2 49 1 50)} "hs-query-all" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "host-call" "host-global" "document" "querySelector" "list" "body") :bytecode (20 0 0 20 1 0 20 2 0 1 3 0 48 1 1 4 0 1 6 0 52 5 0 1 48 3 16 0 49 2 50)} "hs-query-first" {:upvalue-count 0 :arity 1 :constants ("host-call" "host-global" "document" "querySelector") :bytecode (20 0 0 20 1 0 1 2 0 48 1 1 3 0 16 0 49 3 50)} "hs-query-last" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body" ">" "len" 0 "nth" "-" 1) :bytecode (20 0 0 20 1 0 48 0 16 0 48 2 17 1 16 1 52 3 0 1 1 4 0 52 2 0 2 33 22 0 16 1 16 1 52 3 0 1 1 7 0 52 6 0 2 52 5 0 2 32 1 0 2 50)} "hs-first" {:upvalue-count 0 :arity 2 :constants ("dom-query-all") :bytecode (20 0 0 16 0 16 1 49 2 50)} "hs-last" {:upvalue-count 0 :arity 2 :constants ("dom-query-all" ">" "len" 0 "nth" "-" 1) :bytecode (20 0 0 16 0 16 1 48 2 17 2 16 2 52 2 0 1 1 3 0 52 1 0 2 33 22 0 16 2 16 2 52 2 0 1 1 6 0 52 5 0 2 52 4 0 2 32 1 0 2 50)} "hs-repeat-times" {:upvalue-count 0 :arity 3 :constants ({:upvalue-count 3 :arity 1 :constants ("<" "+" 1) :bytecode (16 0 18 0 52 0 0 2 33 21 0 18 1 48 0 5 18 2 16 0 1 2 0 52 1 0 2 49 1 32 1 0 2 50)} 0) :bytecode (51 0 0 1 0 1 1 1 2 17 2 5 16 2 1 1 0 49 1 50)} "hs-repeat-forever" {:upvalue-count 0 :arity 2 :constants ({:upvalue-count 2 :arity 0 :constants () :bytecode (18 0 48 0 5 18 1 49 0 50)}) :bytecode (51 0 0 1 0 1 1 17 1 5 16 1 49 0 50)} "hs-fetch" {:upvalue-count 0 :arity 2 :constants ("list" io-fetch "=" "json" io-parse-json "text" io-parse-text "html" io-parse-html) :bytecode (1 1 0 16 0 52 0 0 2 112 17 2 16 1 1 3 0 52 2 0 2 33 13 0 1 4 0 16 2 52 0 0 2 112 32 52 0 16 1 1 5 0 52 2 0 2 33 13 0 1 6 0 16 2 52 0 0 2 112 32 27 0 16 1 1 7 0 52 2 0 2 33 13 0 1 8 0 16 2 52 0 0 2 112 32 2 0 16 2 50)} "hs-coerce" {:upvalue-count 0 :arity 2 :constants ("=" "Int" "floor" "+" 0 "Integer" "Float" "Number" "String" "str" "Bool" "Boolean" "Array" "list?" "list" "JSON" "Object" "string?" "Fixed" "string-contains?" "Fixed:" ":" "parse-number" "nth" "split" 1 "reduce" {:upvalue-count 0 :arity 2 :constants ("*" 10) :bytecode (16 0 1 1 0 52 0 0 2 50)} "range" "/" "*" 0.5 "HTML" "Values" "Fragment" "Date") :bytecode (16 1 1 1 0 52 0 0 2 33 16 0 16 0 1 4 0 52 3 0 2 52 2 0 1 32 219 1 16 1 1 5 0 52 0 0 2 33 16 0 16 0 1 4 0 52 3 0 2 52 2 0 1 32 191 1 16 1 1 6 0 52 0 0 2 33 12 0 16 0 1 4 0 52 3 0 2 32 167 1 16 1 1 7 0 52 0 0 2 33 12 0 16 0 1 4 0 52 3 0 2 32 143 1 16 1 1 8 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 122 1 16 1 1 10 0 52 0 0 2 33 13 0 16 0 33 4 0 3 32 1 0 4 32 97 1 16 1 1 11 0 52 0 0 2 33 13 0 16 0 33 4 0 3 32 1 0 4 32 72 1 16 1 1 12 0 52 0 0 2 33 23 0 16 0 52 13 0 1 33 5 0 16 0 32 6 0 16 0 52 14 0 1 32 37 1 16 1 1 15 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 16 1 16 1 1 16 0 52 0 0 2 33 19 0 16 0 52 17 0 1 33 5 0 16 0 32 2 0 16 0 32 241 0 16 1 1 18 0 52 0 0 2 6 34 10 0 5 16 1 1 20 0 52 19 0 2 33 133 0 16 1 1 21 0 52 19 0 2 33 23 0 16 1 1 21 0 52 24 0 2 1 25 0 52 23 0 2 52 22 0 1 32 3 0 1 4 0 17 2 16 0 1 4 0 52 3 0 2 17 3 16 2 1 4 0 52 0 0 2 33 13 0 16 3 52 2 0 1 52 9 0 1 32 54 0 51 27 0 1 25 0 1 4 0 16 2 52 28 0 2 52 26 0 3 17 4 16 3 16 4 52 30 0 2 1 31 0 52 3 0 2 52 2 0 1 16 4 52 29 0 2 17 5 16 5 52 9 0 1 32 82 0 16 1 1 32 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 61 0 16 1 1 33 0 52 0 0 2 33 5 0 16 0 32 44 0 16 1 1 34 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 23 0 16 1 1 35 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 2 0 16 0 50)} "hs-add" {:upvalue-count 0 :arity 2 :constants ("string?" "str" "+") :bytecode (16 0 52 0 0 1 6 34 7 0 5 16 1 52 0 0 1 33 11 0 16 0 16 1 52 1 0 2 32 8 0 16 0 16 1 52 2 0 2 50)} "hs-make" {:upvalue-count 0 :arity 1 :constants ("=" "Object" "dict" "Array" "list" "Set" "Map") :bytecode (16 0 1 1 0 52 0 0 2 33 7 0 52 2 0 0 32 61 0 16 0 1 3 0 52 0 0 2 33 7 0 52 4 0 0 32 42 0 16 0 1 5 0 52 0 0 2 33 7 0 52 4 0 0 32 23 0 16 0 1 6 0 52 0 0 2 33 7 0 52 2 0 0 32 4 0 52 2 0 0 50)} "hs-install" {:upvalue-count 0 :arity 1 :constants ("me") :bytecode (16 0 20 0 0 49 1 50)} "hs-measure" {:upvalue-count 0 :arity 1 :constants ("list" io-measure) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-transition" {:upvalue-count 0 :arity 4 :constants ("dom-set-style" "transition" "str" " " "/" 1000 "s" "hs-settle") :bytecode (16 3 33 34 0 20 0 0 16 0 1 1 0 16 1 1 3 0 16 3 1 5 0 52 4 0 2 1 6 0 52 2 0 4 48 3 32 1 0 2 5 20 0 0 16 0 16 1 16 2 48 3 5 16 3 33 10 0 20 7 0 16 0 49 1 32 1 0 2 50)} "hs-type-check" {:upvalue-count 0 :arity 2 :constants ("nil?" "=" "Number" "number?" "String" "string?" "Boolean" "Array" "list?" "Object" "dict?") :bytecode (16 0 52 0 0 1 33 4 0 3 32 119 0 16 1 1 2 0 52 1 0 2 33 9 0 16 0 52 3 0 1 32 98 0 16 1 1 4 0 52 1 0 2 33 9 0 16 0 52 5 0 1 32 77 0 16 1 1 6 0 52 1 0 2 33 22 0 16 0 3 52 1 0 2 6 34 8 0 5 16 0 4 52 1 0 2 32 43 0 16 1 1 7 0 52 1 0 2 33 9 0 16 0 52 8 0 1 32 22 0 16 1 1 9 0 52 1 0 2 33 9 0 16 0 52 10 0 1 32 1 0 3 50)} "hs-type-check-strict" {:upvalue-count 0 :arity 2 :constants ("nil?" "hs-type-check") :bytecode (16 0 52 0 0 1 33 4 0 4 32 9 0 20 1 0 16 0 16 1 49 2 50)} "hs-strict-eq" {:upvalue-count 0 :arity 2 :constants ("=" "type-of") :bytecode (16 0 52 1 0 1 16 1 52 1 0 1 52 0 0 2 6 33 9 0 5 16 0 16 1 52 0 0 2 50)} "hs-falsy?" {:upvalue-count 0 :arity 1 :constants ("nil?" "=" "string?" "" "list?" "len" 0) :bytecode (16 0 52 0 0 1 33 4 0 3 32 89 0 16 0 4 52 1 0 2 33 4 0 3 32 75 0 16 0 52 2 0 1 6 33 10 0 5 16 0 1 3 0 52 1 0 2 33 4 0 3 32 48 0 16 0 52 4 0 1 6 33 14 0 5 16 0 52 5 0 1 1 6 0 52 1 0 2 33 4 0 3 32 17 0 16 0 1 6 0 52 1 0 2 33 4 0 3 32 1 0 4 50)} "hs-matches?" {:upvalue-count 0 :arity 2 :constants ("string?" "=" ".*" "string-contains?") :bytecode (16 0 52 0 0 1 33 27 0 16 1 1 2 0 52 1 0 2 33 4 0 3 32 8 0 16 0 16 1 52 3 0 2 32 1 0 4 50)} "hs-contains?" {:upvalue-count 0 :arity 2 :constants ("nil?" "string?" "string-contains?" "str" "list?" "filter" {:upvalue-count 1 :arity 1 :constants ("hs-contains?") :bytecode (20 0 0 18 0 16 0 49 2 50)} "=" "len" 0 "first" "hs-contains?" "rest") :bytecode (16 0 52 0 0 1 33 4 0 4 32 112 0 16 0 52 1 0 1 33 15 0 16 0 16 1 52 3 0 1 52 2 0 2 32 88 0 16 0 52 4 0 1 33 78 0 16 1 52 4 0 1 33 14 0 51 6 0 1 0 16 1 52 5 0 2 32 52 0 16 0 52 8 0 1 1 9 0 52 7 0 2 33 4 0 4 32 32 0 16 0 52 10 0 1 16 1 52 7 0 2 33 4 0 3 32 13 0 20 11 0 16 0 52 12 0 1 16 1 49 2 32 1 0 4 50)} "hs-empty?" {:upvalue-count 0 :arity 1 :constants ("nil?" "string?" "=" "len" 0 "list?" "dict?" "keys") :bytecode (16 0 52 0 0 1 33 4 0 3 32 80 0 16 0 52 1 0 1 33 16 0 16 0 52 3 0 1 1 4 0 52 2 0 2 32 55 0 16 0 52 5 0 1 33 16 0 16 0 52 3 0 1 1 4 0 52 2 0 2 32 30 0 16 0 52 6 0 1 33 20 0 16 0 52 7 0 1 52 3 0 1 1 4 0 52 2 0 2 32 1 0 4 50)} {:upvalue-count 0 :arity 1 :constants ("first") :bytecode (16 0 52 0 0 1 50)} {:upvalue-count 0 :arity 1 :constants ("last") :bytecode (16 0 52 0 0 1 50)} "hs-template" {:upvalue-count 0 :arity 1 :constants ("" 0 "len" {:upvalue-count 5 :arity 0 :constants ("<" "nth" "=" "$" "+" 1 "{" 2 {:upvalue-count 3 :arity 2 :constants (">=" "=" "nth" "}" 1 "+" "-" "{") :bytecode (16 0 18 0 52 0 0 2 33 5 0 16 0 32 118 0 18 1 16 0 52 2 0 2 1 3 0 52 1 0 2 33 42 0 16 1 1 4 0 52 1 0 2 33 5 0 16 0 32 22 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 6 0 2 49 2 32 58 0 18 1 16 0 52 2 0 2 1 7 0 52 1 0 2 33 25 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 5 0 2 49 2 32 15 0 18 2 16 0 1 4 0 52 5 0 2 16 1 49 2 50)} "slice" "str" "cek-eval" "hs-to-sx" "hs-compile" {:upvalue-count 3 :arity 1 :constants ("<" "nth" ">=" "a" "<=" "z" "A" "Z" "0" "9" "=" "_" "." "+" 1) :bytecode (16 0 18 0 52 0 0 2 6 33 118 0 5 18 1 16 0 52 1 0 2 17 1 16 1 1 3 0 52 2 0 2 6 33 10 0 5 16 1 1 5 0 52 4 0 2 6 34 80 0 5 16 1 1 6 0 52 2 0 2 6 33 10 0 5 16 1 1 7 0 52 4 0 2 6 34 52 0 5 16 1 1 8 0 52 2 0 2 6 33 10 0 5 16 1 1 9 0 52 4 0 2 6 34 24 0 5 16 1 1 11 0 52 10 0 2 6 34 10 0 5 16 1 1 12 0 52 10 0 2 33 16 0 18 2 16 0 1 14 0 52 13 0 2 49 1 32 2 0 16 0 50)}) :bytecode (18 0 18 1 52 0 0 2 33 13 1 18 2 18 0 52 1 0 2 17 0 16 0 1 3 0 52 2 0 2 6 33 16 0 5 18 0 1 5 0 52 4 0 2 18 1 52 0 0 2 33 197 0 18 2 18 0 1 5 0 52 4 0 2 52 1 0 2 1 6 0 52 2 0 2 33 91 0 18 0 1 7 0 52 4 0 2 17 1 51 8 0 0 1 0 2 1 2 17 2 5 16 2 16 1 1 5 0 48 2 17 3 18 2 16 1 16 3 52 9 0 3 17 4 18 3 20 11 0 20 12 0 20 13 0 16 4 48 1 48 1 48 1 52 10 0 2 19 3 5 16 3 1 5 0 52 4 0 2 19 0 5 18 4 49 0 32 78 0 18 0 1 5 0 52 4 0 2 17 1 51 14 0 0 1 0 2 1 2 17 2 5 16 2 16 1 48 1 17 3 18 2 16 1 16 3 52 9 0 3 17 4 18 3 20 11 0 20 12 0 20 13 0 16 4 48 1 48 1 48 1 52 10 0 2 19 3 5 16 3 19 0 5 18 4 49 0 32 27 0 18 3 16 0 52 10 0 2 19 3 5 18 0 1 5 0 52 4 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (1 0 0 17 1 1 1 0 17 2 16 0 52 2 0 1 17 3 51 3 0 1 2 1 3 1 0 1 1 1 4 17 4 5 16 4 48 0 5 16 1 50)} "hs-make-object" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 1 :arity 1 :constants ("dict-set!" "first" "nth" 1) :bytecode (18 0 16 0 52 1 0 1 16 0 1 3 0 52 2 0 2 52 0 0 3 50)}) :bytecode (65 0 0 17 1 51 1 0 1 1 16 0 52 0 0 2 5 16 1 50)} "hs-method-call" {:upvalue-count 0 :arity 3 :constants ("=" "map" "first" "push" "append!" "filter" "join" "indexOf" {:upvalue-count 2 :arity 2 :constants ("=" "len" 0 -1 "first" "rest" "+" 1) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 6 0 1 3 0 32 39 0 16 0 52 4 0 1 18 0 52 0 0 2 33 5 0 16 1 32 19 0 18 1 16 0 52 5 0 1 16 1 1 7 0 52 6 0 2 49 2 50)} 0) :rest-arity 2 :bytecode (16 1 1 1 0 52 0 0 2 33 15 0 16 2 52 2 0 1 16 0 52 1 0 2 32 127 0 16 1 1 3 0 52 0 0 2 33 18 0 16 0 16 2 52 2 0 1 52 4 0 2 5 16 0 32 97 0 16 1 1 5 0 52 0 0 2 33 15 0 16 2 52 2 0 1 16 0 52 5 0 2 32 70 0 16 1 1 6 0 52 0 0 2 33 15 0 16 0 16 2 52 2 0 1 52 6 0 2 32 43 0 16 1 1 7 0 52 0 0 2 33 30 0 16 2 52 2 0 1 17 3 51 8 0 1 3 1 4 17 4 5 16 4 16 0 1 9 0 49 2 32 1 0 2 50)} "hs-beep" {:upvalue-count 0 :arity 1 :constants () :bytecode (16 0 50)} "hs-prop-is" {:upvalue-count 0 :arity 2 :constants ("not" "hs-falsy?" "host-get") :bytecode (20 1 0 20 2 0 16 0 16 1 48 2 48 1 52 0 0 1 50)} "hs-slice" {:upvalue-count 0 :arity 3 :constants ("nil?" 0 "len" "+" 1 "slice") :bytecode (16 1 52 0 0 1 33 6 0 1 1 0 32 2 0 16 1 17 3 16 2 52 0 0 1 33 9 0 16 0 52 2 0 1 32 9 0 16 2 1 4 0 52 3 0 2 17 4 16 0 16 3 16 4 52 5 0 3 50)} "hs-sorted-by" {:upvalue-count 0 :arity 2 :constants ("map" {:upvalue-count 1 :arity 1 :constants ("list") :bytecode (18 0 16 0 48 1 16 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1) :bytecode (16 0 1 1 0 52 0 0 2 50)} "sort" {:upvalue-count 0 :arity 2 :constants ("<" "first") :bytecode (16 0 52 1 0 1 16 1 52 1 0 1 52 0 0 2 33 4 0 3 32 1 0 4 50)}) :bytecode (51 1 0 1 1 16 0 52 0 0 2 17 2 51 2 0 51 4 0 16 2 52 3 0 2 52 0 0 2 50)} "hs-sorted-by-desc" {:upvalue-count 0 :arity 2 :constants ("map" {:upvalue-count 1 :arity 1 :constants ("list") :bytecode (18 0 16 0 48 1 16 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1) :bytecode (16 0 1 1 0 52 0 0 2 50)} "sort" {:upvalue-count 0 :arity 2 :constants (">" "first") :bytecode (16 0 52 1 0 1 16 1 52 1 0 1 52 0 0 2 33 4 0 3 32 1 0 4 50)}) :bytecode (51 1 0 1 1 16 0 52 0 0 2 17 2 51 2 0 51 4 0 16 2 52 3 0 2 52 0 0 2 50)} "hs-split-by" {:upvalue-count 0 :arity 2 :constants ("split") :bytecode (16 0 16 1 52 0 0 2 50)} "hs-joined-by" {:upvalue-count 0 :arity 2 :constants ("join") :bytecode (16 1 16 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("map" {:upvalue-count 1 :arity 1 :constants ("list") :bytecode (18 0 16 0 48 1 16 0 52 0 0 2 50)} "sort" "first" {:upvalue-count 1 :arity 3 :constants ("=" "len" 0 "first" {:upvalue-count 2 :arity 1 :constants ("=" "len" 0 "first" "rest") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 4 0 2 32 38 0 16 0 52 3 0 1 52 3 0 1 18 0 52 0 0 2 33 9 0 16 0 52 3 0 1 32 10 0 18 1 16 0 52 4 0 1 49 1 50)} "rest" "append" "list" "nth" 1 "filter" {:upvalue-count 1 :arity 1 :constants ("not" "=") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)}) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 5 0 16 1 32 66 0 16 0 52 3 0 1 17 3 51 4 0 1 3 1 4 17 4 5 16 4 16 2 48 1 17 5 18 0 16 0 52 5 0 1 16 1 16 5 1 9 0 52 8 0 2 52 7 0 1 52 6 0 2 51 11 0 1 5 16 2 52 10 0 2 49 3 50)} "list") :bytecode (51 1 0 1 1 16 0 52 0 0 2 17 2 20 3 0 16 2 52 0 0 2 52 2 0 1 17 3 51 4 0 1 4 17 4 5 16 4 16 3 52 5 0 0 16 2 49 3 50)} {:upvalue-count 0 :arity 2 :constants ("reverse" "hs-sorted-by") :bytecode (20 1 0 16 0 16 1 48 2 52 0 0 1 50)}) :bytecode (51 1 0 128 0 0 5 51 1 0 128 2 0 5 51 4 0 128 3 0 5 51 6 0 128 5 0 5 51 8 0 128 7 0 5 51 10 0 128 9 0 5 51 12 0 128 11 0 5 51 14 0 128 13 0 5 51 16 0 128 15 0 5 51 18 0 128 17 0 5 51 20 0 128 19 0 5 51 22 0 128 21 0 5 51 24 0 128 23 0 5 51 26 0 128 25 0 5 51 28 0 128 27 0 5 51 30 0 128 29 0 5 51 32 0 128 31 0 5 51 34 0 128 33 0 5 51 36 0 128 35 0 5 51 38 0 128 37 0 5 51 40 0 128 39 0 5 51 42 0 128 41 0 5 51 44 0 128 43 0 5 51 46 0 128 45 0 5 51 48 0 128 47 0 5 51 50 0 128 49 0 5 51 52 0 128 51 0 5 51 54 0 128 53 0 5 51 56 0 128 55 0 5 51 58 0 128 57 0 5 51 60 0 128 59 0 5 51 62 0 128 61 0 5 51 64 0 128 63 0 5 51 66 0 128 65 0 5 51 68 0 128 67 0 5 51 70 0 128 69 0 5 51 72 0 128 71 0 5 51 74 0 128 73 0 5 51 76 0 128 75 0 5 51 77 0 128 41 0 5 51 78 0 128 43 0 5 51 80 0 128 79 0 5 51 82 0 128 81 0 5 51 84 0 128 83 0 5 51 86 0 128 85 0 5 51 88 0 128 87 0 5 51 90 0 128 89 0 5 51 92 0 128 91 0 5 51 94 0 128 93 0 5 51 96 0 128 95 0 5 51 98 0 128 97 0 5 51 99 0 128 91 0 5 51 100 0 128 93 0 50))) + :constants ("hs-each" {:upvalue-count 0 :arity 2 :constants ("list?" "for-each") :bytecode (16 0 52 0 0 1 33 11 0 16 1 16 0 52 1 0 2 32 6 0 16 1 16 0 49 1 50)} "hs-on" {:upvalue-count 0 :arity 3 :constants ("dom-listen") :bytecode (20 0 0 16 0 16 1 16 2 49 3 50)} "hs-on-every" "hs-init" {:upvalue-count 0 :arity 1 :constants () :bytecode (16 0 49 0 50)} "hs-wait" {:upvalue-count 0 :arity 1 :constants ("list" io-sleep) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-wait-for" {:upvalue-count 0 :arity 2 :constants ("list" io-wait-event) :bytecode (1 1 0 16 0 16 1 52 0 0 3 112 50)} "hs-settle" {:upvalue-count 0 :arity 1 :constants ("list" io-settle) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-toggle-class!" {:upvalue-count 0 :arity 2 :constants ("host-call" "host-get" "classList" "toggle") :bytecode (20 0 0 20 1 0 16 0 1 2 0 48 2 1 3 0 16 1 49 3 50)} "hs-toggle-between!" {:upvalue-count 0 :arity 3 :constants ("dom-has-class?" "dom-remove-class" "dom-add-class") :bytecode (20 0 0 16 0 16 1 48 2 33 22 0 20 1 0 16 0 16 1 48 2 5 20 2 0 16 0 16 2 49 2 32 19 0 20 1 0 16 0 16 2 48 2 5 20 2 0 16 0 16 1 49 2 50)} "hs-toggle-style!" {:upvalue-count 0 :arity 2 :constants ("dom-get-style" "=" "visibility" "hidden" "dom-set-style" "visible" "display" "opacity" "none" "0" "") :bytecode (20 0 0 16 0 16 1 48 2 17 2 16 1 1 2 0 52 1 0 2 33 42 0 16 2 1 3 0 52 1 0 2 33 15 0 20 4 0 16 0 16 1 1 5 0 49 3 32 12 0 20 4 0 16 0 16 1 1 3 0 49 3 32 151 0 16 1 1 6 0 52 1 0 2 6 34 10 0 5 16 1 1 7 0 52 1 0 2 33 74 0 16 2 1 8 0 52 1 0 2 6 34 10 0 5 16 2 1 9 0 52 1 0 2 33 15 0 20 4 0 16 0 16 1 1 10 0 49 3 32 30 0 20 4 0 16 0 16 1 16 1 1 6 0 52 1 0 2 33 6 0 1 8 0 32 3 0 1 9 0 49 3 32 51 0 16 2 1 10 0 52 1 0 2 6 34 8 0 5 16 2 2 52 1 0 2 33 15 0 20 4 0 16 0 16 1 1 3 0 49 3 32 12 0 20 4 0 16 0 16 1 1 10 0 49 3 50)} "hs-take!" {:upvalue-count 0 :arity 4 :constants ("list?" "list" "host-get" "parentNode" "dom-child-list" "=" "class" "for-each" {:upvalue-count 1 :arity 1 :constants ("dom-remove-class") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dom-add-class" {:upvalue-count 1 :arity 1 :constants ("dom-remove-attr") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dom-set-attr" "true") :bytecode (16 3 33 23 0 16 3 52 0 0 1 33 5 0 16 3 32 6 0 16 3 52 1 0 1 32 31 0 20 2 0 16 0 1 3 0 48 2 17 4 16 4 33 10 0 20 4 0 16 4 48 1 32 4 0 52 1 0 0 17 4 16 1 1 6 0 52 5 0 2 33 24 0 51 8 0 1 2 16 4 52 7 0 2 5 20 9 0 16 0 16 2 49 2 32 24 0 51 10 0 1 2 16 4 52 7 0 2 5 20 11 0 16 0 16 2 1 12 0 49 3 50)} "hs-put!" {:upvalue-count 0 :arity 3 :constants ("=" "into" "dom-set-inner-html" "before" "dom-insert-adjacent-html" "beforebegin" "after" "afterend" "start" "afterbegin" "end" "beforeend") :bytecode (16 1 1 1 0 52 0 0 2 33 12 0 20 2 0 16 2 16 0 49 2 32 109 0 16 1 1 3 0 52 0 0 2 33 15 0 20 4 0 16 2 1 5 0 16 0 49 3 32 82 0 16 1 1 6 0 52 0 0 2 33 15 0 20 4 0 16 2 1 7 0 16 0 49 3 32 55 0 16 1 1 8 0 52 0 0 2 33 15 0 20 4 0 16 2 1 9 0 16 0 49 3 32 28 0 16 1 1 10 0 52 0 0 2 33 15 0 20 4 0 16 2 1 11 0 16 0 49 3 32 1 0 2 50)} "hs-navigate!" {:upvalue-count 0 :arity 1 :constants ("list" io-navigate) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-scroll!" {:upvalue-count 0 :arity 2 :constants ("host-call" "scrollIntoView" "list" "=" "bottom" "dict" "block" "end" "start") :bytecode (20 0 0 16 0 1 1 0 16 1 1 4 0 52 3 0 2 33 13 0 1 6 0 1 7 0 52 5 0 2 32 10 0 1 6 0 1 8 0 52 5 0 2 52 2 0 1 49 3 50)} "hs-halt!" {:upvalue-count 0 :arity 1 :constants ("event" "host-call" "preventDefault" "list" "=" "stopPropagation") :bytecode (20 0 0 33 50 0 20 1 0 20 0 0 1 2 0 52 3 0 0 48 3 5 16 0 1 0 0 52 4 0 2 33 18 0 20 1 0 20 0 0 1 5 0 52 3 0 0 49 3 32 1 0 2 32 1 0 2 50)} "hs-select!" {:upvalue-count 0 :arity 1 :constants ("host-call" "select" "list") :bytecode (20 0 0 16 0 1 1 0 52 2 0 0 49 3 50)} "hs-reset!" {:upvalue-count 0 :arity 1 :constants ("host-call" "reset" "list") :bytecode (20 0 0 16 0 1 1 0 52 2 0 0 49 3 50)} "hs-next" {:upvalue-count 0 :arity 2 :constants ("=" "*" "dom-next-sibling" {:upvalue-count 2 :arity 1 :constants ("nil?" "dom-matches?" "dom-next-sibling") :bytecode (16 0 52 0 0 1 33 4 0 2 32 28 0 20 1 0 16 0 18 0 48 2 33 5 0 16 0 32 11 0 18 1 20 2 0 16 0 48 1 49 1 50)}) :bytecode (16 1 1 1 0 52 0 0 2 33 10 0 20 2 0 16 0 49 1 32 25 0 20 2 0 16 0 48 1 17 2 51 3 0 1 1 1 3 17 3 5 16 3 16 2 49 1 50)} "hs-previous" {:upvalue-count 0 :arity 2 :constants ("=" "*" "dom-get-prop" "previousElementSibling" {:upvalue-count 2 :arity 1 :constants ("nil?" "dom-matches?" "dom-get-prop" "previousElementSibling") :bytecode (16 0 52 0 0 1 33 4 0 2 32 31 0 20 1 0 16 0 18 0 48 2 33 5 0 16 0 32 14 0 18 1 20 2 0 16 0 1 3 0 48 2 49 1 50)}) :bytecode (16 1 1 1 0 52 0 0 2 33 13 0 20 2 0 16 0 1 3 0 49 2 32 28 0 20 2 0 16 0 1 3 0 48 2 17 2 51 4 0 1 1 1 3 17 3 5 16 3 16 2 49 1 50)} "hs-query-all" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body") :bytecode (20 0 0 20 1 0 48 0 16 0 49 2 50)} "hs-query-first" {:upvalue-count 0 :arity 1 :constants ("host-call" "host-global" "document" "querySelector") :bytecode (20 0 0 20 1 0 1 2 0 48 1 1 3 0 16 0 49 3 50)} "hs-query-last" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "dom-body" ">" "len" 0 "nth" "-" 1) :bytecode (20 0 0 20 1 0 48 0 16 0 48 2 17 1 16 1 52 3 0 1 1 4 0 52 2 0 2 33 22 0 16 1 16 1 52 3 0 1 1 7 0 52 6 0 2 52 5 0 2 32 1 0 2 50)} "hs-first" {:upvalue-count 0 :arity 2 :constants ("dom-query-all") :bytecode (20 0 0 16 0 16 1 49 2 50)} "hs-last" {:upvalue-count 0 :arity 2 :constants ("dom-query-all" ">" "len" 0 "nth" "-" 1) :bytecode (20 0 0 16 0 16 1 48 2 17 2 16 2 52 2 0 1 1 3 0 52 1 0 2 33 22 0 16 2 16 2 52 2 0 1 1 6 0 52 5 0 2 52 4 0 2 32 1 0 2 50)} "hs-repeat-times" {:upvalue-count 0 :arity 3 :constants ({:upvalue-count 3 :arity 1 :constants ("<" "+" 1) :bytecode (16 0 18 0 52 0 0 2 33 21 0 18 1 48 0 5 18 2 16 0 1 2 0 52 1 0 2 49 1 32 1 0 2 50)} 0) :bytecode (51 0 0 1 0 1 1 1 2 17 2 5 16 2 1 1 0 49 1 50)} "hs-repeat-forever" {:upvalue-count 0 :arity 2 :constants ({:upvalue-count 2 :arity 0 :constants () :bytecode (18 0 48 0 5 18 1 49 0 50)}) :bytecode (51 0 0 1 0 1 1 17 1 5 16 1 49 0 50)} "hs-fetch" {:upvalue-count 0 :arity 2 :constants ("list" io-fetch "=" "json" io-parse-json "text" io-parse-text "html" io-parse-html) :bytecode (1 1 0 16 0 52 0 0 2 112 17 2 16 1 1 3 0 52 2 0 2 33 13 0 1 4 0 16 2 52 0 0 2 112 32 52 0 16 1 1 5 0 52 2 0 2 33 13 0 1 6 0 16 2 52 0 0 2 112 32 27 0 16 1 1 7 0 52 2 0 2 33 13 0 1 8 0 16 2 52 0 0 2 112 32 2 0 16 2 50)} "hs-coerce" {:upvalue-count 0 :arity 2 :constants ("=" "Int" "floor" "+" 0 "Integer" "Float" "Number" "String" "str" "Bool" "Boolean" "Array" "list?" "list" "JSON" "Object" "string?" "Fixed" "string-contains?" "Fixed:" ":" "parse-number" "nth" "split" 1 "reduce" {:upvalue-count 0 :arity 2 :constants ("*" 10) :bytecode (16 0 1 1 0 52 0 0 2 50)} "range" "/" "*" 0.5 "HTML" "Values" "Fragment" "Date") :bytecode (16 1 1 1 0 52 0 0 2 33 16 0 16 0 1 4 0 52 3 0 2 52 2 0 1 32 219 1 16 1 1 5 0 52 0 0 2 33 16 0 16 0 1 4 0 52 3 0 2 52 2 0 1 32 191 1 16 1 1 6 0 52 0 0 2 33 12 0 16 0 1 4 0 52 3 0 2 32 167 1 16 1 1 7 0 52 0 0 2 33 12 0 16 0 1 4 0 52 3 0 2 32 143 1 16 1 1 8 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 122 1 16 1 1 10 0 52 0 0 2 33 13 0 16 0 33 4 0 3 32 1 0 4 32 97 1 16 1 1 11 0 52 0 0 2 33 13 0 16 0 33 4 0 3 32 1 0 4 32 72 1 16 1 1 12 0 52 0 0 2 33 23 0 16 0 52 13 0 1 33 5 0 16 0 32 6 0 16 0 52 14 0 1 32 37 1 16 1 1 15 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 16 1 16 1 1 16 0 52 0 0 2 33 19 0 16 0 52 17 0 1 33 5 0 16 0 32 2 0 16 0 32 241 0 16 1 1 18 0 52 0 0 2 6 34 10 0 5 16 1 1 20 0 52 19 0 2 33 133 0 16 1 1 21 0 52 19 0 2 33 23 0 16 1 1 21 0 52 24 0 2 1 25 0 52 23 0 2 52 22 0 1 32 3 0 1 4 0 17 2 16 0 1 4 0 52 3 0 2 17 3 16 2 1 4 0 52 0 0 2 33 13 0 16 3 52 2 0 1 52 9 0 1 32 54 0 51 27 0 1 25 0 1 4 0 16 2 52 28 0 2 52 26 0 3 17 4 16 3 16 4 52 30 0 2 1 31 0 52 3 0 2 52 2 0 1 16 4 52 29 0 2 17 5 16 5 52 9 0 1 32 82 0 16 1 1 32 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 61 0 16 1 1 33 0 52 0 0 2 33 5 0 16 0 32 44 0 16 1 1 34 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 23 0 16 1 1 35 0 52 0 0 2 33 9 0 16 0 52 9 0 1 32 2 0 16 0 50)} "hs-add" {:upvalue-count 0 :arity 2 :constants ("string?" "str" "+") :bytecode (16 0 52 0 0 1 6 34 7 0 5 16 1 52 0 0 1 33 11 0 16 0 16 1 52 1 0 2 32 8 0 16 0 16 1 52 2 0 2 50)} "hs-make" {:upvalue-count 0 :arity 1 :constants ("=" "Object" "dict" "Array" "list" "Set" "Map") :bytecode (16 0 1 1 0 52 0 0 2 33 7 0 52 2 0 0 32 61 0 16 0 1 3 0 52 0 0 2 33 7 0 52 4 0 0 32 42 0 16 0 1 5 0 52 0 0 2 33 7 0 52 4 0 0 32 23 0 16 0 1 6 0 52 0 0 2 33 7 0 52 2 0 0 32 4 0 52 2 0 0 50)} "hs-install" {:upvalue-count 0 :arity 1 :constants ("me") :bytecode (16 0 20 0 0 49 1 50)} "hs-measure" {:upvalue-count 0 :arity 1 :constants ("list" io-measure) :bytecode (1 1 0 16 0 52 0 0 2 112 50)} "hs-transition" {:upvalue-count 0 :arity 4 :constants ("dom-set-style" "transition" "str" " " "/" 1000 "s" "hs-settle") :bytecode (16 3 33 34 0 20 0 0 16 0 1 1 0 16 1 1 3 0 16 3 1 5 0 52 4 0 2 1 6 0 52 2 0 4 48 3 32 1 0 2 5 20 0 0 16 0 16 1 16 2 48 3 5 16 3 33 10 0 20 7 0 16 0 49 1 32 1 0 2 50)} "hs-type-check" {:upvalue-count 0 :arity 2 :constants ("nil?" "=" "Number" "number?" "String" "string?" "Boolean" "Array" "list?" "Object" "dict?") :bytecode (16 0 52 0 0 1 33 4 0 3 32 119 0 16 1 1 2 0 52 1 0 2 33 9 0 16 0 52 3 0 1 32 98 0 16 1 1 4 0 52 1 0 2 33 9 0 16 0 52 5 0 1 32 77 0 16 1 1 6 0 52 1 0 2 33 22 0 16 0 3 52 1 0 2 6 34 8 0 5 16 0 4 52 1 0 2 32 43 0 16 1 1 7 0 52 1 0 2 33 9 0 16 0 52 8 0 1 32 22 0 16 1 1 9 0 52 1 0 2 33 9 0 16 0 52 10 0 1 32 1 0 3 50)} "hs-type-check-strict" {:upvalue-count 0 :arity 2 :constants ("nil?" "hs-type-check") :bytecode (16 0 52 0 0 1 33 4 0 4 32 9 0 20 1 0 16 0 16 1 49 2 50)} "hs-strict-eq" {:upvalue-count 0 :arity 2 :constants ("=" "type-of") :bytecode (16 0 52 1 0 1 16 1 52 1 0 1 52 0 0 2 6 33 9 0 5 16 0 16 1 52 0 0 2 50)} "hs-falsy?" {:upvalue-count 0 :arity 1 :constants ("nil?" "=" "string?" "" "list?" "len" 0) :bytecode (16 0 52 0 0 1 33 4 0 3 32 89 0 16 0 4 52 1 0 2 33 4 0 3 32 75 0 16 0 52 2 0 1 6 33 10 0 5 16 0 1 3 0 52 1 0 2 33 4 0 3 32 48 0 16 0 52 4 0 1 6 33 14 0 5 16 0 52 5 0 1 1 6 0 52 1 0 2 33 4 0 3 32 17 0 16 0 1 6 0 52 1 0 2 33 4 0 3 32 1 0 4 50)} "hs-matches?" {:upvalue-count 0 :arity 2 :constants ("string?" "=" ".*" "string-contains?") :bytecode (16 0 52 0 0 1 33 27 0 16 1 1 2 0 52 1 0 2 33 4 0 3 32 8 0 16 0 16 1 52 3 0 2 32 1 0 4 50)} "hs-contains?" {:upvalue-count 0 :arity 2 :constants ("nil?" "string?" "string-contains?" "str" "list?" "filter" {:upvalue-count 1 :arity 1 :constants ("hs-contains?") :bytecode (20 0 0 18 0 16 0 49 2 50)} "=" "len" 0 "first" "hs-contains?" "rest") :bytecode (16 0 52 0 0 1 33 4 0 4 32 112 0 16 0 52 1 0 1 33 15 0 16 0 16 1 52 3 0 1 52 2 0 2 32 88 0 16 0 52 4 0 1 33 78 0 16 1 52 4 0 1 33 14 0 51 6 0 1 0 16 1 52 5 0 2 32 52 0 16 0 52 8 0 1 1 9 0 52 7 0 2 33 4 0 4 32 32 0 16 0 52 10 0 1 16 1 52 7 0 2 33 4 0 3 32 13 0 20 11 0 16 0 52 12 0 1 16 1 49 2 32 1 0 4 50)} "hs-empty?" {:upvalue-count 0 :arity 1 :constants ("nil?" "string?" "=" "len" 0 "list?" "dict?" "keys") :bytecode (16 0 52 0 0 1 33 4 0 3 32 80 0 16 0 52 1 0 1 33 16 0 16 0 52 3 0 1 1 4 0 52 2 0 2 32 55 0 16 0 52 5 0 1 33 16 0 16 0 52 3 0 1 1 4 0 52 2 0 2 32 30 0 16 0 52 6 0 1 33 20 0 16 0 52 7 0 1 52 3 0 1 1 4 0 52 2 0 2 32 1 0 4 50)} {:upvalue-count 0 :arity 1 :constants ("first") :bytecode (16 0 52 0 0 1 50)} {:upvalue-count 0 :arity 1 :constants ("last") :bytecode (16 0 52 0 0 1 50)} "hs-template" {:upvalue-count 0 :arity 1 :constants ("" 0 "len" {:upvalue-count 5 :arity 0 :constants ("<" "nth" "=" "$" "+" 1 "{" 2 {:upvalue-count 3 :arity 2 :constants (">=" "=" "nth" "}" 1 "+" "-" "{") :bytecode (16 0 18 0 52 0 0 2 33 5 0 16 0 32 118 0 18 1 16 0 52 2 0 2 1 3 0 52 1 0 2 33 42 0 16 1 1 4 0 52 1 0 2 33 5 0 16 0 32 22 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 6 0 2 49 2 32 58 0 18 1 16 0 52 2 0 2 1 7 0 52 1 0 2 33 25 0 18 2 16 0 1 4 0 52 5 0 2 16 1 1 4 0 52 5 0 2 49 2 32 15 0 18 2 16 0 1 4 0 52 5 0 2 16 1 49 2 50)} "slice" "str" "cek-eval" "hs-to-sx" "hs-compile" {:upvalue-count 3 :arity 1 :constants ("<" "nth" ">=" "a" "<=" "z" "A" "Z" "0" "9" "=" "_" "." "+" 1) :bytecode (16 0 18 0 52 0 0 2 6 33 118 0 5 18 1 16 0 52 1 0 2 17 1 16 1 1 3 0 52 2 0 2 6 33 10 0 5 16 1 1 5 0 52 4 0 2 6 34 80 0 5 16 1 1 6 0 52 2 0 2 6 33 10 0 5 16 1 1 7 0 52 4 0 2 6 34 52 0 5 16 1 1 8 0 52 2 0 2 6 33 10 0 5 16 1 1 9 0 52 4 0 2 6 34 24 0 5 16 1 1 11 0 52 10 0 2 6 34 10 0 5 16 1 1 12 0 52 10 0 2 33 16 0 18 2 16 0 1 14 0 52 13 0 2 49 1 32 2 0 16 0 50)}) :bytecode (18 0 18 1 52 0 0 2 33 13 1 18 2 18 0 52 1 0 2 17 0 16 0 1 3 0 52 2 0 2 6 33 16 0 5 18 0 1 5 0 52 4 0 2 18 1 52 0 0 2 33 197 0 18 2 18 0 1 5 0 52 4 0 2 52 1 0 2 1 6 0 52 2 0 2 33 91 0 18 0 1 7 0 52 4 0 2 17 1 51 8 0 0 1 0 2 1 2 17 2 5 16 2 16 1 1 5 0 48 2 17 3 18 2 16 1 16 3 52 9 0 3 17 4 18 3 20 11 0 20 12 0 20 13 0 16 4 48 1 48 1 48 1 52 10 0 2 19 3 5 16 3 1 5 0 52 4 0 2 19 0 5 18 4 49 0 32 78 0 18 0 1 5 0 52 4 0 2 17 1 51 14 0 0 1 0 2 1 2 17 2 5 16 2 16 1 48 1 17 3 18 2 16 1 16 3 52 9 0 3 17 4 18 3 20 11 0 20 12 0 20 13 0 16 4 48 1 48 1 48 1 52 10 0 2 19 3 5 16 3 19 0 5 18 4 49 0 32 27 0 18 3 16 0 52 10 0 2 19 3 5 18 0 1 5 0 52 4 0 2 19 0 5 18 4 49 0 32 1 0 2 50)}) :bytecode (1 0 0 17 1 1 1 0 17 2 16 0 52 2 0 1 17 3 51 3 0 1 2 1 3 1 0 1 1 1 4 17 4 5 16 4 48 0 5 16 1 50)} "hs-make-object" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 1 :arity 1 :constants ("dict-set!" "first" "nth" 1) :bytecode (18 0 16 0 52 1 0 1 16 0 1 3 0 52 2 0 2 52 0 0 3 50)}) :bytecode (65 0 0 17 1 51 1 0 1 1 16 0 52 0 0 2 5 16 1 50)} "hs-method-call" {:upvalue-count 0 :arity 3 :constants ("=" "map" "first" "push" "append!" "filter" "join" "indexOf" {:upvalue-count 2 :arity 2 :constants ("=" "len" 0 -1 "first" "rest" "+" 1) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 6 0 1 3 0 32 39 0 16 0 52 4 0 1 18 0 52 0 0 2 33 5 0 16 1 32 19 0 18 1 16 0 52 5 0 1 16 1 1 7 0 52 6 0 2 49 2 50)} 0) :rest-arity 2 :bytecode (16 1 1 1 0 52 0 0 2 33 15 0 16 2 52 2 0 1 16 0 52 1 0 2 32 127 0 16 1 1 3 0 52 0 0 2 33 18 0 16 0 16 2 52 2 0 1 52 4 0 2 5 16 0 32 97 0 16 1 1 5 0 52 0 0 2 33 15 0 16 2 52 2 0 1 16 0 52 5 0 2 32 70 0 16 1 1 6 0 52 0 0 2 33 15 0 16 0 16 2 52 2 0 1 52 6 0 2 32 43 0 16 1 1 7 0 52 0 0 2 33 30 0 16 2 52 2 0 1 17 3 51 8 0 1 3 1 4 17 4 5 16 4 16 0 1 9 0 49 2 32 1 0 2 50)} "hs-beep" {:upvalue-count 0 :arity 1 :constants () :bytecode (16 0 50)} "hs-prop-is" {:upvalue-count 0 :arity 2 :constants ("not" "hs-falsy?" "host-get") :bytecode (20 1 0 20 2 0 16 0 16 1 48 2 48 1 52 0 0 1 50)} "hs-slice" {:upvalue-count 0 :arity 3 :constants ("nil?" 0 "len" "+" 1 "slice") :bytecode (16 1 52 0 0 1 33 6 0 1 1 0 32 2 0 16 1 17 3 16 2 52 0 0 1 33 9 0 16 0 52 2 0 1 32 9 0 16 2 1 4 0 52 3 0 2 17 4 16 0 16 3 16 4 52 5 0 3 50)} "hs-sorted-by" {:upvalue-count 0 :arity 2 :constants ("map" {:upvalue-count 1 :arity 1 :constants ("list") :bytecode (18 0 16 0 48 1 16 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1) :bytecode (16 0 1 1 0 52 0 0 2 50)} "sort" {:upvalue-count 0 :arity 2 :constants ("<" "first") :bytecode (16 0 52 1 0 1 16 1 52 1 0 1 52 0 0 2 33 4 0 3 32 1 0 4 50)}) :bytecode (51 1 0 1 1 16 0 52 0 0 2 17 2 51 2 0 51 4 0 16 2 52 3 0 2 52 0 0 2 50)} "hs-sorted-by-desc" {:upvalue-count 0 :arity 2 :constants ("map" {:upvalue-count 1 :arity 1 :constants ("list") :bytecode (18 0 16 0 48 1 16 0 52 0 0 2 50)} {:upvalue-count 0 :arity 1 :constants ("nth" 1) :bytecode (16 0 1 1 0 52 0 0 2 50)} "sort" {:upvalue-count 0 :arity 2 :constants (">" "first") :bytecode (16 0 52 1 0 1 16 1 52 1 0 1 52 0 0 2 33 4 0 3 32 1 0 4 50)}) :bytecode (51 1 0 1 1 16 0 52 0 0 2 17 2 51 2 0 51 4 0 16 2 52 3 0 2 52 0 0 2 50)} "hs-split-by" {:upvalue-count 0 :arity 2 :constants ("split") :bytecode (16 0 16 1 52 0 0 2 50)} "hs-joined-by" {:upvalue-count 0 :arity 2 :constants ("join") :bytecode (16 1 16 0 52 0 0 2 50)} {:upvalue-count 0 :arity 2 :constants ("map" {:upvalue-count 1 :arity 1 :constants ("list") :bytecode (18 0 16 0 48 1 16 0 52 0 0 2 50)} "sort" "first" {:upvalue-count 1 :arity 3 :constants ("=" "len" 0 "first" {:upvalue-count 2 :arity 1 :constants ("=" "len" 0 "first" "rest") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 4 0 2 32 38 0 16 0 52 3 0 1 52 3 0 1 18 0 52 0 0 2 33 9 0 16 0 52 3 0 1 32 10 0 18 1 16 0 52 4 0 1 49 1 50)} "rest" "append" "list" "nth" 1 "filter" {:upvalue-count 1 :arity 1 :constants ("not" "=") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)}) :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 5 0 16 1 32 66 0 16 0 52 3 0 1 17 3 51 4 0 1 3 1 4 17 4 5 16 4 16 2 48 1 17 5 18 0 16 0 52 5 0 1 16 1 16 5 1 9 0 52 8 0 2 52 7 0 1 52 6 0 2 51 11 0 1 5 16 2 52 10 0 2 49 3 50)} "list") :bytecode (51 1 0 1 1 16 0 52 0 0 2 17 2 20 3 0 16 2 52 0 0 2 52 2 0 1 17 3 51 4 0 1 4 17 4 5 16 4 16 3 52 5 0 0 16 2 49 3 50)} {:upvalue-count 0 :arity 2 :constants ("reverse" "hs-sorted-by") :bytecode (20 1 0 16 0 16 1 48 2 52 0 0 1 50)}) :bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 3 0 128 4 0 5 51 6 0 128 5 0 5 51 8 0 128 7 0 5 51 10 0 128 9 0 5 51 12 0 128 11 0 5 51 14 0 128 13 0 5 51 16 0 128 15 0 5 51 18 0 128 17 0 5 51 20 0 128 19 0 5 51 22 0 128 21 0 5 51 24 0 128 23 0 5 51 26 0 128 25 0 5 51 28 0 128 27 0 5 51 30 0 128 29 0 5 51 32 0 128 31 0 5 51 34 0 128 33 0 5 51 36 0 128 35 0 5 51 38 0 128 37 0 5 51 40 0 128 39 0 5 51 42 0 128 41 0 5 51 44 0 128 43 0 5 51 46 0 128 45 0 5 51 48 0 128 47 0 5 51 50 0 128 49 0 5 51 52 0 128 51 0 5 51 54 0 128 53 0 5 51 56 0 128 55 0 5 51 58 0 128 57 0 5 51 60 0 128 59 0 5 51 62 0 128 61 0 5 51 64 0 128 63 0 5 51 66 0 128 65 0 5 51 68 0 128 67 0 5 51 70 0 128 69 0 5 51 72 0 128 71 0 5 51 74 0 128 73 0 5 51 76 0 128 75 0 5 51 78 0 128 77 0 5 51 79 0 128 43 0 5 51 80 0 128 45 0 5 51 82 0 128 81 0 5 51 84 0 128 83 0 5 51 86 0 128 85 0 5 51 88 0 128 87 0 5 51 90 0 128 89 0 5 51 92 0 128 91 0 5 51 94 0 128 93 0 5 51 96 0 128 95 0 5 51 98 0 128 97 0 5 51 100 0 128 99 0 5 51 101 0 128 93 0 5 51 102 0 128 95 0 50))) diff --git a/shared/static/wasm/sx/module-manifest.json b/shared/static/wasm/sx/module-manifest.json index f7a6b134..50cf8b38 100644 --- a/shared/static/wasm/sx/module-manifest.json +++ b/shared/static/wasm/sx/module-manifest.json @@ -955,6 +955,7 @@ "hs-compiler" ], "exports": [ + "hs-each", "hs-on", "hs-on-every", "hs-init", diff --git a/sx/sx/home-stepper.sx b/sx/sx/home-stepper.sx index 3ac91fa6..3e29aecd 100644 --- a/sx/sx/home-stepper.sx +++ b/sx/sx/home-stepper.sx @@ -343,25 +343,7 @@ ((tokens (list))) (dict-set! step-ref "v" 0) (build-code-tokens (first parsed) tokens step-ref 0) - (reset! code-tokens tokens) - (when - (client?) - (set-timeout - (fn - () - (let - ((cv (dom-query "[data-code-view]"))) - (when - cv - (host-set! - cv - "innerHTML" - "FIXED") - (log-info - (str - "DIRECT innerHTML kids=" - (len (dom-child-nodes cv))))))) - 0)))))) + (reset! code-tokens tokens))))) (let ((_eff (let ((first-run (signal true))) (effect (fn () (let ((cur (deref step-idx))) (if (deref first-run) (do (reset! first-run false) (host-call (host-global "queueMicrotask") (host-callback (fn () (update-code-highlight) (rebuild-preview cur) (run-post-render-hooks))))) (schedule-idle (fn () (build-code-dom) (rebuild-preview cur) (update-code-highlight) (run-post-render-hooks)))))))))) (div diff --git a/sx/sx/pretext-demo.sx b/sx/sx/pretext-demo.sx index dd6da839..469cbee9 100644 --- a/sx/sx/pretext-demo.sx +++ b/sx/sx/pretext-demo.sx @@ -1,306 +1,329 @@ ;; Pretext demo — DOM-free text layout ;; -;; Shows Knuth-Plass optimal line breaking and text positioning, -;; computed entirely in pure SX with one IO primitive (text-measure). -;; Server renders with monospace approximation; browser uses canvas.measureText. +;; Visual-first: shows typeset text, then explains how. +;; All layout computed server-side in pure SX. + +;; Render a single line of positioned words +(defcomp + ~pretext-demo/render-line + (&key line-words line-widths gap-w y) + (let + ((positions (list)) (x 0)) + (for-each + (fn + (i) + (let + ((w (nth line-words i)) (ww (nth line-widths i))) + (append! + positions + (span + :style (str + "position:absolute;left:" + (+ x 16) + "px;top:" + (+ y 12) + "px;font-size:15px;line-height:24px;white-space:nowrap;") + w)) + (set! x (+ x ww gap-w)))) + (range (len line-words))) + positions)) + +;; Render a paragraph as positioned words using break-lines output +(defcomp + ~pretext-demo/typeset-block + (&key words widths space-width max-width line-height label) + (let + ((ranges (break-lines widths space-width max-width)) + (lh (or line-height 24))) + (div + (~tw + :tokens "relative rounded-lg border border-stone-200 bg-white overflow-hidden") + (when + label + (div + (~tw :tokens "px-4 pt-3 pb-1") + (span + (~tw + :tokens "text-xs font-medium uppercase tracking-wide text-stone-400") + label))) + (div + :style (str + "position:relative;height:" + (* (len ranges) lh) + "px;padding:12px 16px;") + (map-indexed + (fn + (line-idx range) + (let + ((start (first range)) + (end (nth range 1)) + (y (* line-idx lh)) + (line-words (slice words start end)) + (line-widths (slice widths start end)) + (total-word-w (reduce + 0 line-widths)) + (gaps (max 1 (- (len line-words) 1))) + (slack (- max-width total-word-w)) + (is-last (= line-idx (- (len ranges) 1))) + (gap-w (if is-last space-width (/ slack gaps)))) + (~pretext-demo/render-line + :line-words line-words + :line-widths line-widths + :gap-w gap-w + :y y))) + ranges)) + (div + (~tw + :tokens "px-4 py-2 border-t border-stone-100 bg-stone-50 flex justify-between") + (span + (~tw :tokens "text-xs text-stone-400") + (str (len ranges) " lines, " (len words) " words")) + (span + (~tw :tokens "text-xs text-stone-400") + (str "width: " max-width "px")))))) + +;; Simple greedy word wrap for comparison +(defcomp + ~pretext-demo/greedy-block + (&key words widths space-width max-width line-height label) + (let + ((n (len widths)) + (lines (list)) + (current-start 0) + (current-width 0) + (lh (or line-height 24))) + (for-each + (fn + (i) + (let + ((w (nth widths i)) + (needed + (if (= i current-start) w (+ current-width space-width w)))) + (if + (and (> needed max-width) (not (= i current-start))) + (do + (append! lines (list current-start i)) + (set! current-start i) + (set! current-width w)) + (set! current-width needed)))) + (range n)) + (append! lines (list current-start n)) + (div + (~tw + :tokens "relative rounded-lg border border-stone-200 bg-white overflow-hidden") + (when + label + (div + (~tw :tokens "px-4 pt-3 pb-1") + (span + (~tw + :tokens "text-xs font-medium uppercase tracking-wide text-stone-400") + label))) + (div + :style (str + "position:relative;height:" + (* (len lines) lh) + "px;padding:12px 16px;") + (map-indexed + (fn + (line-idx range) + (let + ((start (first range)) + (end (nth range 1)) + (y (* line-idx lh)) + (line-words (slice words start end)) + (line-widths (slice widths start end)) + (total-word-w (reduce + 0 line-widths)) + (gaps (max 1 (- (len line-words) 1))) + (slack (- max-width total-word-w)) + (is-last (= line-idx (- (len lines) 1))) + (gap-w (if is-last space-width (/ slack gaps)))) + (~pretext-demo/render-line + :line-words line-words + :line-widths line-widths + :gap-w gap-w + :y y))) + lines)) + (div + (~tw + :tokens "px-4 py-2 border-t border-stone-100 bg-stone-50 flex justify-between") + (span + (~tw :tokens "text-xs text-stone-400") + (str (len lines) " lines (greedy)")) + (span + (~tw :tokens "text-xs text-stone-400") + (str "width: " max-width "px")))))) (defcomp ~pretext-demo/content () - (div - (~tw :tokens "space-y-8") - (div - (~tw :tokens "border-b border-stone-200 pb-6") - (h1 - (~tw :tokens "text-2xl font-bold text-stone-900") - "Pretext: DOM-free Text Layout") - (p - (~tw :tokens "mt-2 text-stone-600") - "Pure arithmetic text layout — one " - (code - (~tw :tokens "bg-stone-100 px-1 rounded text-violet-700") - "perform") - " for glyph measurement, everything else is deterministic SX functions over numbers. " - "Knuth-Plass optimal line breaking. Liang's hyphenation. No DOM reflow.")) - (div - (~tw - :tokens "rounded-lg border border-blue-200 bg-blue-50 p-6 space-y-4") - (h2 - (~tw :tokens "text-lg font-semibold text-blue-900") - "Architecture: one IO boundary") - (div - (~tw :tokens "grid grid-cols-1 md:grid-cols-2 gap-4") - (div - (~tw :tokens "rounded border border-blue-200 bg-white p-4") - (h3 - (~tw - :tokens "text-sm font-medium text-blue-600 uppercase tracking-wide mb-2") - "IO (platform-resolved)") - (p - (~tw :tokens "text-sm text-blue-800 font-mono") - "(perform (text-measure font size text))") - (p - (~tw :tokens "text-xs text-blue-600 mt-2") - "Server: OCaml monospace approximation (otfm font tables later). " - "Browser: canvas.measureText on offscreen canvas.")) - (div - (~tw :tokens "rounded border border-blue-200 bg-white p-4") - (h3 - (~tw - :tokens "text-sm font-medium text-blue-600 uppercase tracking-wide mb-2") - "Pure SX (no IO)") - (ul - (~tw :tokens "text-sm text-blue-800 space-y-1") - (li "Knuth-Plass line breaking (DP over break candidates)") - (li "Liang's hyphenation (trie over character patterns)") - (li "Position calculation (running x/y sums)") - (li "Badness/demerits (cubic deviation penalty)"))))) - (div - (~tw :tokens "space-y-4") - (h2 - (~tw :tokens "text-lg font-semibold text-stone-800") - "Line breaking with fixed widths") - (p - (~tw :tokens "text-sm text-stone-600") - "These examples use fixed glyph widths to demonstrate the Knuth-Plass algorithm. " - "No IO — pure functions over numbers.") - (let - ((widths (list 30 30 30 30 30 30 30 30)) - (words - (list "The" "quick" "brown" "fox" "jumps" "over" "the" "dog")) - (space-width 5) - (max-width 75)) - (let - ((ranges (break-lines widths space-width max-width)) - (positioned - (position-lines - words - widths - (break-lines widths space-width max-width) - space-width - 24 - 0 - 0))) - (div - (~tw :tokens "rounded-lg border border-stone-200 bg-white p-6") - (h3 - (~tw - :tokens "text-sm font-medium text-stone-500 uppercase tracking-wide mb-3") - "8 words × 30px, space 5px, max-width 75px") - (div - (~tw :tokens "space-y-1") - (map-indexed - (fn - (line-idx line) - (div - (~tw :tokens "flex items-baseline gap-1") - (span - (~tw :tokens "text-xs text-stone-400 w-6 shrink-0") - (str "L" (str (+ line-idx 1)))) - (div - (~tw :tokens "flex gap-1") - (map - (fn - (word-info) - (span - (~tw - :tokens "inline-block bg-violet-100 text-violet-800 px-2 py-0.5 rounded text-sm font-mono") - (get word-info :word))) - line)))) - positioned)) - (p - (~tw :tokens "text-xs text-stone-500 mt-3") - (str - (len ranges) - " lines, " - (len words) - " words. " - "Break points: " - (join - ", " - (map (fn (r) (str (first r) "→" (nth r 1))) ranges)))))))) + (let + ((sample-text "In the beginning was the Word, and the Word was with God, and the Word was God. The same was in the beginning with God. All things were made by him; and without him was not any thing made that was made. In him was life; and the life was the light of men.") + (sample-words + (split + "In the beginning was the Word, and the Word was with God, and the Word was God. The same was in the beginning with God. All things were made by him; and without him was not any thing made that was made. In him was life; and the life was the light of men." + " ")) + (char-w 9.6) + (space-w 9.6)) (let - ((widths (list 80 20 50 30 60 40 70 25 55 35)) - (words - (list - "Typesetting" - "is" - "about" - "the" - "optimal" - "line" - "breaking" - "of" - "words" - "into")) - (space-width 6) - (max-width 120)) - (let - ((ranges (break-lines widths space-width max-width)) - (positioned - (position-lines - words - widths - (break-lines widths space-width max-width) - space-width - 24 - 0 - 0))) + ((sample-widths (map (fn (w) (* (len w) char-w)) sample-words))) + (div + (~tw :tokens "space-y-10") (div - (~tw :tokens "rounded-lg border border-stone-200 bg-white p-6") - (h3 - (~tw - :tokens "text-sm font-medium text-stone-500 uppercase tracking-wide mb-3") - "10 words, varying widths, max-width 120px") + (~tw :tokens "space-y-4") (div - (~tw :tokens "space-y-1") - (map-indexed - (fn - (line-idx line) - (div - (~tw :tokens "flex items-baseline gap-1") - (span - (~tw :tokens "text-xs text-stone-400 w-6 shrink-0") - (str "L" (str (+ line-idx 1)))) - (div - (~tw :tokens "flex gap-1") - (map - (fn - (word-info) - (let - ((w (get word-info :width))) - (span - :style (str "min-width:" w "px") - (~tw - :tokens "inline-block bg-emerald-100 text-emerald-800 px-2 py-0.5 rounded text-sm font-mono") - (get word-info :word)))) - line)))) - positioned)) + (h1 + (~tw :tokens "text-3xl font-bold text-stone-900 tracking-tight") + "Pretext") + (p + (~tw :tokens "mt-1 text-lg text-stone-500") + "DOM-free text layout. One IO boundary. Pure arithmetic.")) + (div + (~tw :tokens "max-w-xl mx-auto mt-6") + (~pretext-demo/typeset-block + :words sample-words + :widths sample-widths + :space-width space-w + :max-width 520 + :label "Knuth-Plass optimal line breaking — John 1:1–4"))) + (div + (~tw :tokens "rounded-lg border border-violet-200 bg-violet-50 p-5") (p - (~tw :tokens "text-xs text-stone-500 mt-3") - (str - (len ranges) - " lines. Break points: " - (join - ", " - (map (fn (r) (str (first r) "→" (nth r 1))) ranges))))))) - (div - (~tw :tokens "rounded-lg border border-stone-200 bg-white p-6") - (h3 - (~tw - :tokens "text-sm font-medium text-stone-500 uppercase tracking-wide mb-3") - "Badness function: how lines are scored") - (p - (~tw :tokens "text-sm text-stone-600 mb-4") - "Badness grows cubically with slack. Exact fit = 0. " - "Lines over max-width get penalty 100,000.") - (div - (~tw :tokens "grid grid-cols-2 md:grid-cols-4 gap-3") - (map - (fn - (used) - (let - ((bad (line-badness used 100))) - (div - (~tw :tokens "rounded border border-stone-200 p-3 text-center") - (div - (~tw :tokens "text-2xl font-mono font-bold") - (if - (>= bad 100000) - (span (~tw :tokens "text-red-600") "∞") - (span (~tw :tokens "text-stone-800") (str bad)))) - (div - (~tw :tokens "text-xs text-stone-500 mt-1") - (str "used=" used "/100"))))) - (list 100 90 80 70 60 50 110 120)))) - (div - (~tw :tokens "rounded-lg border border-stone-200 bg-white p-6") - (h3 - (~tw - :tokens "text-sm font-medium text-stone-500 uppercase tracking-wide mb-3") - "Demerits: (1 + badness)² + penalty²") - (div - (~tw :tokens "grid grid-cols-3 md:grid-cols-5 gap-3") - (map - (fn - (pair) - (let - ((bad (first pair)) (pen (nth pair 1))) - (div - (~tw :tokens "rounded border border-stone-200 p-3 text-center") - (div - (~tw :tokens "text-xl font-mono font-bold text-stone-800") - (str (compute-demerits bad pen))) - (div - (~tw :tokens "text-xs text-stone-500 mt-1") - (str "b=" bad " p=" pen))))) - (list (list 0 0) (list 5 0) (list 10 0) (list 0 5) (list 10 5))))) - (div - (~tw :tokens "space-y-4") - (h2 - (~tw :tokens "text-lg font-semibold text-stone-800") - "Hyphenation (Liang's algorithm)") - (p - (~tw :tokens "text-sm text-stone-600") - "Trie-based pattern matching. Digit patterns encode hyphenation levels — " - "odd levels allow breaks. Patterns like " - (code (~tw :tokens "bg-stone-100 px-1 rounded") "hy1p") - " mean: after 'y' in 'hyp...' insert a level-1 break point.") - (let - ((trie (make-hyphenation-trie (list "hy1p" "he2n" "hen3at" "hena4t" "1na" "n2at" "1tio" "2io" "o2i" "1tic" "1mo" "4m1p" "1pu" "put1" "1er" "pro1g" "1gram" "2gra" "program5" "pro3")))) + (~tw :tokens "text-sm text-violet-800") + (strong "One ") + (code (~tw :tokens "bg-violet-100 px-1 rounded") "perform") + " for glyph measurement. Everything else — line breaking, positioning, hyphenation, justification — is pure SX functions over numbers. " + "Server renders with font-table lookups. Browser uses " + (code "canvas.measureText") + ". Same algorithm, same output.")) (div - (~tw :tokens "rounded-lg border border-stone-200 bg-white p-6") - (h3 - (~tw - :tokens "text-sm font-medium text-stone-500 uppercase tracking-wide mb-3") - "Syllable decomposition") + (~tw :tokens "space-y-3") + (h2 + (~tw :tokens "text-xl font-semibold text-stone-800") + "Greedy vs optimal") + (p + (~tw :tokens "text-sm text-stone-500") + "Most web text uses greedy word wrap — break when the next word doesn't fit. " + "Knuth-Plass considers all possible breaks simultaneously, minimizing total raggedness.") + (let + ((narrow-widths (map (fn (w) (* (len w) 7.8)) sample-words)) + (narrow-sw 7.8) + (narrow-max 340)) + (div + (~tw :tokens "grid grid-cols-1 md:grid-cols-2 gap-4") + (~pretext-demo/greedy-block + :words sample-words + :widths narrow-widths + :space-width narrow-sw + :max-width narrow-max + :line-height 22 + :label "Greedy (browser default)") + (~pretext-demo/typeset-block + :words sample-words + :widths narrow-widths + :space-width narrow-sw + :max-width narrow-max + :line-height 22 + :label "Knuth-Plass optimal")))) + (div + (~tw :tokens "space-y-3") + (h2 + (~tw :tokens "text-xl font-semibold text-stone-800") + "How lines are scored") + (p + (~tw :tokens "text-sm text-stone-500") + "Each line gets a badness score — how far it deviates from ideal width. " + "The algorithm minimizes total demerits (1 + badness)² across all lines.") (div - (~tw :tokens "grid grid-cols-1 md:grid-cols-3 gap-4") + (~tw :tokens "grid grid-cols-4 md:grid-cols-8 gap-2") (map (fn - (word) + (used) (let - ((syllables (hyphenate-word trie word)) - (points (find-hyphenation-points trie word))) + ((bad (line-badness used 100)) + (pct (str (min used 100) "%"))) (div - (~tw :tokens "rounded border border-stone-200 p-4") + (~tw + :tokens "rounded border border-stone-200 p-2 text-center") + (div + :style (str + "height:4px;background:linear-gradient(90deg,hsl(263,70%,50%) " + pct + ",#e7e5e4 " + pct + ");border-radius:2px;margin-bottom:6px;") + "") + (div + (~tw :tokens "text-sm font-mono font-bold") + (if + (>= bad 100000) + (span (~tw :tokens "text-red-500") "∞") + (span (~tw :tokens "text-stone-700") (str bad)))) + (div + (~tw :tokens "text-xs text-stone-400 mt-0.5") + (str used "%"))))) + (list 100 95 90 85 80 70 50 110)))) + (div + (~tw :tokens "space-y-3") + (h2 + (~tw :tokens "text-xl font-semibold text-stone-800") + "Hyphenation") + (p + (~tw :tokens "text-sm text-stone-500") + "Liang's algorithm: a trie of character patterns with numeric levels. " + "Odd levels mark valid break points.") + (let + ((trie (make-hyphenation-trie (list "hy1p" "he2n" "hen3at" "hena4t" "1na" "n2at" "1tio" "2io" "o2i" "1tic" "1mo" "4m1p" "1pu" "put1" "1er" "pro1g" "1gram" "2gra" "program5" "pro3" "ty1" "1graph" "2ph")))) + (div + (~tw :tokens "flex flex-wrap gap-3") + (map + (fn + (word) + (let + ((syllables (hyphenate-word trie word))) (div (~tw - :tokens "text-lg font-mono font-bold text-stone-800 mb-2") - (join "·" syllables)) - (div - (~tw :tokens "text-xs text-stone-500") - (str - "Break points: " - (if - (empty? points) - "none" - (join ", " (map str points)))))))) - (list "hyphen" "computation" "programming")))))) - (div - (~tw :tokens "rounded-lg border border-amber-200 bg-amber-50 p-6") - (h2 (~tw :tokens "text-lg font-semibold text-amber-900") "How it works") - (ol - (~tw - :tokens "list-decimal list-inside text-amber-800 space-y-2 text-sm") - (li - (code "measure-text") - " calls " - (code "(perform (text-measure ...))") - " — the only IO") - (li - (code "break-lines") - " runs Knuth-Plass DP over word widths to find optimal breaks") - (li - (code "position-lines") - " converts breaks + widths into x/y coordinates (pure arithmetic)") - (li - (code "hyphenate-word") - " uses Liang's trie algorithm to find syllable boundaries") - (li - "All layout is " - (strong "deterministic") - " — same input widths → same output positions, every time") - (li - "Server renders with monospace approximation; browser uses " - (code "canvas.measureText")))))) \ No newline at end of file + :tokens "rounded-lg border border-stone-200 bg-white px-4 py-3 text-center") + (div + (~tw + :tokens "text-lg font-mono font-semibold text-stone-800 tracking-wide") + (map-indexed + (fn + (i syl) + (if + (= i 0) + (span syl) + (list + (span + (~tw :tokens "text-violet-400 mx-0.5") + "·") + (span syl)))) + syllables)) + (div (~tw :tokens "text-xs text-stone-400 mt-1") word)))) + (list "hyphen" "computation" "programming" "typography"))))) + (div + (~tw + :tokens "rounded-lg border border-stone-200 bg-stone-50 p-5 space-y-2") + (h3 + (~tw + :tokens "text-sm font-semibold text-stone-600 uppercase tracking-wide") + "The pipeline") + (ol + (~tw + :tokens "list-decimal list-inside text-sm text-stone-600 space-y-1") + (li + (code "measure-text") + " — the only IO. Server: font tables. Browser: " + (code "canvas.measureText")) + (li + (code "break-lines") + " — Knuth-Plass DP over word widths → optimal break points") + (li + (code "position-lines") + " — pure arithmetic: widths + breaks → x,y coordinates") + (li + (code "hyphenate-word") + " — Liang's trie: character patterns → syllable boundaries") + (li + "All layout is " + (strong "deterministic") + " — same widths → same positions, every time"))))))) \ No newline at end of file