From 9b060ef8c575c2ef496803b2908afbbaa4e3bbe6 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 4 Apr 2026 21:31:17 +0000 Subject: [PATCH] Bytecode compiler: desugar let-match, fix SPA navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bytecode compiler now handles let-match (both variants): - Variant 1: (let-match name expr {:k v} body...) — named binding + destructure - Variant 2: (let-match {:k v} expr body...) — pattern-only destructure Desugars to sequential let + get calls — no new opcodes needed. This was the last blocker for SPA navigation. The bytecoded orchestration and router modules used let-match which compiled to CALL_PRIM "let-match" (undefined at runtime). Now desugared at compile time. Also synced dist/sx/ sources with web/ and recompiled all 26 .sxbc modules. 2650/2650 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/compiler.sx | 44 + shared/static/wasm/sx/compiler.sx | 44 + shared/static/wasm/sx/compiler.sxbc | 4 +- shared/static/wasm/sx/deps.sx | 673 ++++++------ shared/static/wasm/sx/deps.sxbc | 4 +- shared/static/wasm/sx/engine.sx | 1565 +++++++++++++-------------- shared/static/wasm/sx/engine.sxbc | 4 +- 7 files changed, 1208 insertions(+), 1130 deletions(-) diff --git a/lib/compiler.sx b/lib/compiler.sx index 404f2d71..d40e018b 100644 --- a/lib/compiler.sx +++ b/lib/compiler.sx @@ -41,6 +41,7 @@ compile-or compile-begin compile-let + desugar-let-match compile-letrec compile-lambda compile-define @@ -250,6 +251,8 @@ (compile-let em args scope tail?) (= name "let*") (compile-let em args scope tail?) + (= name "let-match") + (compile-let em (desugar-let-match args) scope tail?) (= name "begin") (compile-begin em args scope tail?) (= name "do") @@ -446,6 +449,47 @@ (compile-expr em (first exprs) scope false) (emit-op em 5) (compile-begin em (rest exprs) scope tail?)))))) + (define + desugar-let-match + (fn + (args) + (let + ((first-arg (first args))) + (if (dict? first-arg) + ;; Variant 2: (let-match {:k v} expr body...) + (let + ((pattern first-arg) + (expr (nth args 1)) + (body (slice args 2)) + (src-sym (make-symbol "__lm_tmp")) + (bindings (list))) + (append! bindings (list src-sym expr)) + (for-each + (fn (k) + (append! bindings + (list (get pattern k) + (list (make-symbol "get") src-sym (str k))))) + (keys pattern)) + (cons bindings body)) + ;; Variant 1: (let-match name expr {:k v} body...) + (let + ((name-sym first-arg) + (expr (nth args 1)) + (pattern (nth args 2)) + (body (slice args 3)) + (src-sym (if (= (str name-sym) "_") + (make-symbol "__lm_tmp") + name-sym)) + (bindings (list))) + (append! bindings (list src-sym expr)) + (when (dict? pattern) + (for-each + (fn (k) + (append! bindings + (list (get pattern k) + (list (make-symbol "get") src-sym (str k))))) + (keys pattern))) + (cons bindings body)))))) (define compile-let (fn diff --git a/shared/static/wasm/sx/compiler.sx b/shared/static/wasm/sx/compiler.sx index 404f2d71..d40e018b 100644 --- a/shared/static/wasm/sx/compiler.sx +++ b/shared/static/wasm/sx/compiler.sx @@ -41,6 +41,7 @@ compile-or compile-begin compile-let + desugar-let-match compile-letrec compile-lambda compile-define @@ -250,6 +251,8 @@ (compile-let em args scope tail?) (= name "let*") (compile-let em args scope tail?) + (= name "let-match") + (compile-let em (desugar-let-match args) scope tail?) (= name "begin") (compile-begin em args scope tail?) (= name "do") @@ -446,6 +449,47 @@ (compile-expr em (first exprs) scope false) (emit-op em 5) (compile-begin em (rest exprs) scope tail?)))))) + (define + desugar-let-match + (fn + (args) + (let + ((first-arg (first args))) + (if (dict? first-arg) + ;; Variant 2: (let-match {:k v} expr body...) + (let + ((pattern first-arg) + (expr (nth args 1)) + (body (slice args 2)) + (src-sym (make-symbol "__lm_tmp")) + (bindings (list))) + (append! bindings (list src-sym expr)) + (for-each + (fn (k) + (append! bindings + (list (get pattern k) + (list (make-symbol "get") src-sym (str k))))) + (keys pattern)) + (cons bindings body)) + ;; Variant 1: (let-match name expr {:k v} body...) + (let + ((name-sym first-arg) + (expr (nth args 1)) + (pattern (nth args 2)) + (body (slice args 3)) + (src-sym (if (= (str name-sym) "_") + (make-symbol "__lm_tmp") + name-sym)) + (bindings (list))) + (append! bindings (list src-sym expr)) + (when (dict? pattern) + (for-each + (fn (k) + (append! bindings + (list (get pattern k) + (list (make-symbol "get") src-sym (str k))))) + (keys pattern))) + (cons bindings body)))))) (define compile-let (fn diff --git a/shared/static/wasm/sx/compiler.sxbc b/shared/static/wasm/sx/compiler.sxbc index 1133c80a..8a91c218 100644 --- a/shared/static/wasm/sx/compiler.sxbc +++ b/shared/static/wasm/sx/compiler.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "3af11645dc55adf4" +(sxbc 1 "e3329cf88fa1883b" (code - :constants ("make-pool" {:upvalue-count 0 :arity 0 :constants ("entries" "primitive?" "mutable-list" "list" "index" "_count" 0) :bytecode (1 0 0 1 2 0 52 1 0 1 33 7 0 52 2 0 0 32 4 0 52 3 0 0 1 4 0 1 5 0 1 6 0 65 1 0 65 2 0 50)} "pool-add" {:upvalue-count 0 :arity 2 :constants ("Add a value to the constant pool, return its index. Deduplicates." "serialize" "get" "index" "has-key?" "_count" "dict-set!" "+" 1 "append!" "entries") :bytecode (1 0 0 5 16 1 52 1 0 1 17 2 16 0 1 3 0 52 2 0 2 17 3 16 3 16 2 52 4 0 2 33 11 0 16 3 16 2 52 2 0 2 32 59 0 16 3 1 5 0 52 2 0 2 17 4 16 3 16 2 16 4 52 6 0 3 5 16 3 1 5 0 16 4 1 8 0 52 7 0 2 52 6 0 3 5 16 0 1 10 0 52 2 0 2 16 1 52 9 0 2 5 16 4 50)} "make-scope" {:upvalue-count 0 :arity 1 :constants ("next-slot" 0 "upvalues" "list" "locals" "parent" "is-function") :bytecode (1 0 0 1 1 0 1 2 0 52 3 0 0 1 4 0 52 3 0 0 1 5 0 16 0 1 6 0 4 65 5 0 50)} "scope-define-local" {:upvalue-count 0 :arity 2 :constants ("Add a local variable, return its slot index.\n Idempotent: if name already has a slot, return it." "first" "filter" {:upvalue-count 1 :arity 1 :constants ("=" "get" "name") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "get" "locals" "slot" "next-slot" "append!" "mutable" "name" "dict-set!" "+" 1) :bytecode (1 0 0 5 51 3 0 1 1 16 0 1 5 0 52 4 0 2 52 2 0 2 52 1 0 1 17 2 16 2 33 12 0 16 2 1 6 0 52 4 0 2 32 63 0 16 0 1 7 0 52 4 0 2 17 3 16 0 1 5 0 52 4 0 2 1 9 0 4 1 6 0 16 3 1 10 0 16 1 65 3 0 52 8 0 2 5 16 0 1 7 0 16 3 1 13 0 52 12 0 2 52 11 0 3 5 16 3 50)} "scope-resolve" {:upvalue-count 0 :arity 2 :constants ("Resolve a variable name. Returns {:type \"local\"|\"upvalue\"|\"global\", :index N}.\n Upvalue captures only happen at function boundaries (is-function=true).\n Let scopes share the enclosing function's frame — their locals are\n accessed directly without upvalue indirection." "nil?" "index" "type" "global" "get" "locals" "some" {:upvalue-count 1 :arity 1 :constants ("=" "get" "name") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "first" "filter" "slot" "local" "upvalues" "uv-index" "upvalue" "parent" "scope-resolve" "=" "is-function" "len" "append!" "is-local" "name") :bytecode (1 0 0 5 16 0 52 1 0 1 33 17 0 1 2 0 16 1 1 3 0 1 4 0 65 2 0 32 60 1 16 0 1 6 0 52 5 0 2 17 2 51 8 0 1 1 16 2 52 7 0 2 17 3 16 3 33 41 0 51 8 0 1 1 16 2 52 10 0 2 52 9 0 1 17 4 1 2 0 16 4 1 11 0 52 5 0 2 1 3 0 1 12 0 65 2 0 32 246 0 16 0 1 13 0 52 5 0 2 17 4 51 8 0 1 1 16 4 52 7 0 2 17 5 16 5 33 41 0 51 8 0 1 1 16 4 52 10 0 2 52 9 0 1 17 6 1 2 0 16 6 1 14 0 52 5 0 2 1 3 0 1 15 0 65 2 0 32 176 0 16 0 1 16 0 52 5 0 2 17 6 16 6 52 1 0 1 33 17 0 1 2 0 16 1 1 3 0 1 4 0 65 2 0 32 139 0 20 17 0 16 6 16 1 48 2 17 7 16 7 1 3 0 52 5 0 2 1 4 0 52 18 0 2 33 5 0 16 7 32 104 0 16 0 1 19 0 52 5 0 2 33 90 0 16 0 1 13 0 52 5 0 2 52 20 0 1 17 8 16 0 1 13 0 52 5 0 2 1 2 0 16 7 1 2 0 52 5 0 2 1 22 0 16 7 1 3 0 52 5 0 2 1 12 0 52 18 0 2 1 14 0 16 8 1 23 0 16 1 65 4 0 52 21 0 2 5 1 2 0 16 8 1 3 0 1 15 0 65 2 0 32 2 0 16 7 50)} "make-emitter" {:upvalue-count 0 :arity 0 :constants ("pool" "make-pool" "bytecode" "primitive?" "mutable-list" "list") :bytecode (1 0 0 20 1 0 48 0 1 2 0 1 4 0 52 3 0 1 33 7 0 52 4 0 0 32 4 0 52 5 0 0 65 2 0 50)} "emit-byte" {:upvalue-count 0 :arity 2 :constants ("append!" "get" "bytecode") :bytecode (16 0 1 2 0 52 1 0 2 16 1 52 0 0 2 50)} "emit-u16" {:upvalue-count 0 :arity 2 :constants ("emit-byte" "mod" 256 "floor" "/") :bytecode (20 0 0 16 0 16 1 1 2 0 52 1 0 2 48 2 5 20 0 0 16 0 16 1 1 2 0 52 4 0 2 52 3 0 1 1 2 0 52 1 0 2 49 2 50)} "emit-i16" {:upvalue-count 0 :arity 2 :constants ("<" 0 "+" 65536 "emit-u16") :bytecode (16 1 1 1 0 52 0 0 2 33 12 0 16 1 1 3 0 52 2 0 2 32 2 0 16 1 17 2 20 4 0 16 0 16 2 49 2 50)} "emit-op" {:upvalue-count 0 :arity 2 :constants ("emit-byte") :bytecode (20 0 0 16 0 16 1 49 2 50)} "emit-const" {:upvalue-count 0 :arity 2 :constants ("pool-add" "get" "pool" "emit-op" 1 "emit-u16") :bytecode (20 0 0 16 0 1 2 0 52 1 0 2 16 1 48 2 17 2 20 3 0 16 0 1 4 0 48 2 5 20 5 0 16 0 16 2 49 2 50)} "current-offset" {:upvalue-count 0 :arity 1 :constants ("len" "get" "bytecode") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 50)} "patch-i16" {:upvalue-count 0 :arity 3 :constants ("Patch a previously emitted i16 at the given bytecode offset." "<" 0 "+" 65536 "get" "bytecode" "set-nth!" "mod" 256 1 "floor" "/") :bytecode (1 0 0 5 16 2 1 2 0 52 1 0 2 33 12 0 16 2 1 4 0 52 3 0 2 32 2 0 16 2 17 3 16 0 1 6 0 52 5 0 2 17 4 16 4 16 1 16 3 1 9 0 52 8 0 2 52 7 0 3 5 16 4 16 1 1 10 0 52 3 0 2 16 3 1 9 0 52 12 0 2 52 11 0 1 1 9 0 52 8 0 2 52 7 0 3 50)} "compile-expr" {:upvalue-count 0 :arity 4 :constants ("Compile an expression. tail? indicates tail position for TCO." "nil?" "emit-op" 2 "=" "type-of" "number" "emit-const" "string" "boolean" 3 4 "keyword" "keyword-name" "symbol" "compile-symbol" "symbol-name" "list" "empty?" 64 "emit-u16" 0 "compile-list" "dict" "compile-dict") :bytecode (1 0 0 5 16 1 52 1 0 1 33 13 0 20 2 0 16 0 1 3 0 49 2 32 10 1 16 1 52 5 0 1 1 6 0 52 4 0 2 33 12 0 20 7 0 16 0 16 1 49 2 32 238 0 16 1 52 5 0 1 1 8 0 52 4 0 2 33 12 0 20 7 0 16 0 16 1 49 2 32 210 0 16 1 52 5 0 1 1 9 0 52 4 0 2 33 24 0 20 2 0 16 0 16 1 33 6 0 1 10 0 32 3 0 1 11 0 49 2 32 170 0 16 1 52 5 0 1 1 12 0 52 4 0 2 33 16 0 20 7 0 16 0 16 1 52 13 0 1 49 2 32 138 0 16 1 52 5 0 1 1 14 0 52 4 0 2 33 18 0 20 15 0 16 0 16 1 52 16 0 1 16 2 49 3 32 104 0 16 1 52 5 0 1 1 17 0 52 4 0 2 33 49 0 16 1 52 18 0 1 33 24 0 20 2 0 16 0 1 19 0 48 2 5 20 20 0 16 0 1 21 0 49 2 32 13 0 20 22 0 16 0 16 1 16 2 16 3 49 4 32 39 0 16 1 52 5 0 1 1 23 0 52 4 0 2 33 14 0 20 24 0 16 0 16 1 16 2 49 3 32 9 0 20 7 0 16 0 16 1 49 2 50)} "compile-symbol" {:upvalue-count 0 :arity 3 :constants ("scope-resolve" "=" "get" "type" "local" "emit-op" 16 "emit-byte" "index" "upvalue" 18 "pool-add" "pool" 20 "emit-u16") :bytecode (20 0 0 16 2 16 1 48 2 17 3 16 3 1 3 0 52 2 0 2 1 4 0 52 1 0 2 33 30 0 20 5 0 16 0 1 6 0 48 2 5 20 7 0 16 0 16 3 1 8 0 52 2 0 2 49 2 32 87 0 16 3 1 3 0 52 2 0 2 1 9 0 52 1 0 2 33 30 0 20 5 0 16 0 1 10 0 48 2 5 20 7 0 16 0 16 3 1 8 0 52 2 0 2 49 2 32 38 0 20 11 0 16 0 1 12 0 52 2 0 2 16 1 48 2 17 4 20 5 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 4 49 2 50)} "compile-dict" {:upvalue-count 0 :arity 3 :constants ("keys" "len" "for-each" {:upvalue-count 3 :arity 1 :constants ("emit-const" "compile-expr" "get") :bytecode (20 0 0 18 0 16 0 48 2 5 20 1 0 18 0 18 1 16 0 52 2 0 2 18 2 4 49 4 50)} "emit-op" 65 "emit-u16") :bytecode (16 1 52 0 0 1 17 3 16 3 52 1 0 1 17 4 51 3 0 1 0 1 1 1 2 16 3 52 2 0 2 5 20 4 0 16 0 1 5 0 48 2 5 20 6 0 16 0 16 4 49 2 50)} "compile-list" {:upvalue-count 0 :arity 4 :constants ("first" "rest" "not" "=" "type-of" "symbol" "compile-call" "symbol-name" "if" "compile-if" "when" "compile-when" "and" "compile-and" "or" "compile-or" "let" "compile-let" "let*" "begin" "compile-begin" "do" "lambda" "compile-lambda" "fn" "define" "compile-define" "set!" "compile-set" "quote" "compile-quote" "cond" "compile-cond" "case" "compile-case" "->" "compile-thread" "defcomp" "compile-defcomp" "defisland" "defmacro" "compile-defmacro" "defstyle" "emit-op" 2 "defhandler" "defpage" "defquery" "defaction" "defrelation" "deftype" "defeffect" "quasiquote" "compile-quasiquote" "letrec" "compile-letrec" "match" "compile-match" "perform" "compile-expr" 112 "import" "emit-const" "library" "op" "define-library" "filter" {:upvalue-count 0 :arity 1 :constants ("list?" "not" "empty?" "=" "first" begin) :bytecode (16 0 52 0 0 1 6 33 29 0 5 16 0 52 2 0 1 52 1 0 1 6 33 14 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 50)} "empty?" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-expr" "emit-op" 5) :bytecode (20 0 0 18 0 16 0 18 1 4 48 4 5 20 1 0 18 0 1 2 0 49 2 50)} "init" "last") :bytecode (16 1 52 0 0 1 17 4 16 1 52 1 0 1 17 5 16 4 52 4 0 1 1 5 0 52 3 0 2 52 2 0 1 33 18 0 20 6 0 16 0 16 4 16 5 16 2 16 3 49 5 32 27 4 16 4 52 7 0 1 17 6 16 6 1 8 0 52 3 0 2 33 16 0 20 9 0 16 0 16 5 16 2 16 3 49 4 32 247 3 16 6 1 10 0 52 3 0 2 33 16 0 20 11 0 16 0 16 5 16 2 16 3 49 4 32 219 3 16 6 1 12 0 52 3 0 2 33 16 0 20 13 0 16 0 16 5 16 2 16 3 49 4 32 191 3 16 6 1 14 0 52 3 0 2 33 16 0 20 15 0 16 0 16 5 16 2 16 3 49 4 32 163 3 16 6 1 16 0 52 3 0 2 33 16 0 20 17 0 16 0 16 5 16 2 16 3 49 4 32 135 3 16 6 1 18 0 52 3 0 2 33 16 0 20 17 0 16 0 16 5 16 2 16 3 49 4 32 107 3 16 6 1 19 0 52 3 0 2 33 16 0 20 20 0 16 0 16 5 16 2 16 3 49 4 32 79 3 16 6 1 21 0 52 3 0 2 33 16 0 20 20 0 16 0 16 5 16 2 16 3 49 4 32 51 3 16 6 1 22 0 52 3 0 2 33 14 0 20 23 0 16 0 16 5 16 2 49 3 32 25 3 16 6 1 24 0 52 3 0 2 33 14 0 20 23 0 16 0 16 5 16 2 49 3 32 255 2 16 6 1 25 0 52 3 0 2 33 14 0 20 26 0 16 0 16 5 16 2 49 3 32 229 2 16 6 1 27 0 52 3 0 2 33 14 0 20 28 0 16 0 16 5 16 2 49 3 32 203 2 16 6 1 29 0 52 3 0 2 33 12 0 20 30 0 16 0 16 5 49 2 32 179 2 16 6 1 31 0 52 3 0 2 33 16 0 20 32 0 16 0 16 5 16 2 16 3 49 4 32 151 2 16 6 1 33 0 52 3 0 2 33 16 0 20 34 0 16 0 16 5 16 2 16 3 49 4 32 123 2 16 6 1 35 0 52 3 0 2 33 16 0 20 36 0 16 0 16 5 16 2 16 3 49 4 32 95 2 16 6 1 37 0 52 3 0 2 33 14 0 20 38 0 16 0 16 5 16 2 49 3 32 69 2 16 6 1 39 0 52 3 0 2 33 14 0 20 38 0 16 0 16 5 16 2 49 3 32 43 2 16 6 1 40 0 52 3 0 2 33 14 0 20 41 0 16 0 16 5 16 2 49 3 32 17 2 16 6 1 42 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 246 1 16 6 1 45 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 219 1 16 6 1 46 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 192 1 16 6 1 47 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 165 1 16 6 1 48 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 138 1 16 6 1 49 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 111 1 16 6 1 50 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 84 1 16 6 1 51 0 52 3 0 2 33 15 0 20 43 0 16 0 1 44 0 48 2 5 2 32 57 1 16 6 1 39 0 52 3 0 2 33 14 0 20 38 0 16 0 16 5 16 2 49 3 32 31 1 16 6 1 52 0 52 3 0 2 33 18 0 20 53 0 16 0 16 5 52 0 0 1 16 2 49 3 32 1 1 16 6 1 54 0 52 3 0 2 33 16 0 20 55 0 16 0 16 5 16 2 16 3 49 4 32 229 0 16 6 1 56 0 52 3 0 2 33 16 0 20 57 0 16 0 16 5 16 2 16 3 49 4 32 201 0 16 6 1 58 0 52 3 0 2 33 32 0 20 59 0 16 0 16 5 52 0 0 1 16 2 4 48 4 5 20 43 0 16 0 1 60 0 48 2 5 2 32 157 0 16 6 1 61 0 52 3 0 2 33 41 0 20 62 0 16 0 1 63 0 16 5 52 0 0 1 1 64 0 1 61 0 65 2 0 48 2 5 20 43 0 16 0 1 60 0 48 2 5 2 32 104 0 16 6 1 65 0 52 3 0 2 33 77 0 51 67 0 16 5 52 66 0 2 17 7 16 7 52 68 0 1 52 2 0 1 33 49 0 16 7 52 0 0 1 52 1 0 1 17 8 51 70 0 1 0 1 2 16 8 52 71 0 1 52 69 0 2 5 20 59 0 16 0 16 8 52 72 0 1 16 2 4 49 4 32 1 0 2 32 15 0 20 6 0 16 0 16 4 16 5 16 2 16 3 49 5 50)} "compile-if" {:upvalue-count 0 :arity 4 :constants ("first" "nth" 1 ">" "len" 2 "compile-expr" "emit-op" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+" "nil?") :bytecode (16 1 52 0 0 1 17 4 16 1 1 2 0 52 1 0 2 17 5 16 1 52 4 0 1 1 5 0 52 3 0 2 33 12 0 16 1 1 5 0 52 1 0 2 32 1 0 2 17 6 20 6 0 16 0 16 4 16 2 4 48 4 5 20 7 0 16 0 1 8 0 48 2 5 20 9 0 16 0 48 1 17 7 20 10 0 16 0 1 11 0 48 2 5 20 6 0 16 0 16 5 16 2 16 3 48 4 5 20 7 0 16 0 1 12 0 48 2 5 20 9 0 16 0 48 1 17 8 20 10 0 16 0 1 11 0 48 2 5 20 13 0 16 0 16 7 20 9 0 16 0 48 1 16 7 1 5 0 52 15 0 2 52 14 0 2 48 3 5 16 6 52 16 0 1 33 13 0 20 7 0 16 0 1 5 0 48 2 32 13 0 20 6 0 16 0 16 6 16 2 16 3 48 4 5 20 13 0 16 0 16 8 20 9 0 16 0 48 1 16 8 1 5 0 52 15 0 2 52 14 0 2 49 3 50)} "compile-when" {:upvalue-count 0 :arity 4 :constants ("first" "rest" "compile-expr" "emit-op" 33 "current-offset" "emit-i16" 0 "compile-begin" 32 "patch-i16" "-" "+" 2) :bytecode (16 1 52 0 0 1 17 4 16 1 52 1 0 1 17 5 20 2 0 16 0 16 4 16 2 4 48 4 5 20 3 0 16 0 1 4 0 48 2 5 20 5 0 16 0 48 1 17 6 20 6 0 16 0 1 7 0 48 2 5 20 8 0 16 0 16 5 16 2 16 3 48 4 5 20 3 0 16 0 1 9 0 48 2 5 20 5 0 16 0 48 1 17 7 20 6 0 16 0 1 7 0 48 2 5 20 10 0 16 0 16 6 20 5 0 16 0 48 1 16 6 1 13 0 52 12 0 2 52 11 0 2 48 3 5 20 3 0 16 0 1 13 0 48 2 5 20 10 0 16 0 16 7 20 5 0 16 0 48 1 16 7 1 13 0 52 12 0 2 52 11 0 2 49 3 50)} "compile-and" {:upvalue-count 0 :arity 4 :constants ("empty?" "emit-op" 3 "=" "len" 1 "compile-expr" "first" 6 33 "current-offset" "emit-i16" 0 5 "compile-and" "rest" "patch-i16" "-" "+" 2) :bytecode (16 1 52 0 0 1 33 13 0 20 1 0 16 0 1 2 0 49 2 32 153 0 16 1 52 4 0 1 1 5 0 52 3 0 2 33 20 0 20 6 0 16 0 16 1 52 7 0 1 16 2 16 3 49 4 32 117 0 20 6 0 16 0 16 1 52 7 0 1 16 2 4 48 4 5 20 1 0 16 0 1 8 0 48 2 5 20 1 0 16 0 1 9 0 48 2 5 20 10 0 16 0 48 1 17 4 20 11 0 16 0 1 12 0 48 2 5 20 1 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 1 52 15 0 1 16 2 16 3 48 4 5 20 16 0 16 0 16 4 20 10 0 16 0 48 1 16 4 1 19 0 52 18 0 2 52 17 0 2 49 3 50)} "compile-or" {:upvalue-count 0 :arity 4 :constants ("empty?" "emit-op" 4 "=" "len" 1 "compile-expr" "first" 6 34 "current-offset" "emit-i16" 0 5 "compile-or" "rest" "patch-i16" "-" "+" 2) :bytecode (16 1 52 0 0 1 33 13 0 20 1 0 16 0 1 2 0 49 2 32 153 0 16 1 52 4 0 1 1 5 0 52 3 0 2 33 20 0 20 6 0 16 0 16 1 52 7 0 1 16 2 16 3 49 4 32 117 0 20 6 0 16 0 16 1 52 7 0 1 16 2 4 48 4 5 20 1 0 16 0 1 8 0 48 2 5 20 1 0 16 0 1 9 0 48 2 5 20 10 0 16 0 48 1 17 4 20 11 0 16 0 1 12 0 48 2 5 20 1 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 1 52 15 0 1 16 2 16 3 48 4 5 20 16 0 16 0 16 4 20 10 0 16 0 48 1 16 4 1 19 0 52 18 0 2 52 17 0 2 49 3 50)} "compile-begin" {:upvalue-count 0 :arity 4 :constants ("not" "empty?" "nil?" "get" "parent" "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "list" ">=" "len" 2 "first" "symbol" "symbol-name" "define" "nth" 1 "scope-define-local") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 58 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 40 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 18 0 5 16 0 52 6 0 1 52 8 0 1 1 9 0 52 0 0 2 33 52 0 16 0 1 11 0 52 10 0 2 17 1 16 1 52 1 0 1 1 7 0 52 0 0 2 33 9 0 16 1 52 8 0 1 32 2 0 16 1 17 2 20 12 0 18 0 16 2 49 2 32 1 0 2 50)} "emit-op" 2 "=" "len" 1 "compile-expr" "first" 5 "compile-begin" "rest") :bytecode (16 1 52 1 0 1 52 0 0 1 6 33 18 0 5 16 2 1 4 0 52 3 0 2 52 2 0 1 52 0 0 1 33 14 0 51 6 0 1 2 16 1 52 5 0 2 32 1 0 2 5 16 1 52 1 0 1 33 13 0 20 7 0 16 0 1 8 0 49 2 32 81 0 16 1 52 10 0 1 1 11 0 52 9 0 2 33 20 0 20 12 0 16 0 16 1 52 13 0 1 16 2 16 3 49 4 32 45 0 20 12 0 16 0 16 1 52 13 0 1 16 2 4 48 4 5 20 7 0 16 0 1 14 0 48 2 5 20 15 0 16 0 16 1 52 16 0 1 16 2 16 3 49 4 50)} "compile-let" {:upvalue-count 0 :arity 4 :constants ("=" "type-of" "first" "symbol" "symbol-name" "nth" 1 "slice" 2 "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("append!" "=" "type-of" "first" "symbol" "make-symbol" "nth" 1) :bytecode (18 0 16 0 52 3 0 1 52 2 0 1 1 4 0 52 1 0 2 33 9 0 16 0 52 3 0 1 32 10 0 16 0 52 3 0 1 52 5 0 1 52 0 0 2 5 18 1 16 0 1 7 0 52 6 0 2 52 0 0 2 50)} "concat" "make-symbol" "fn" "cons" "compile-letrec" "rest" "make-scope" "dict-set!" "next-slot" "get" {:upvalue-count 2 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "nth" 1 "scope-define-local" "compile-expr" "emit-op" 17 "emit-byte") :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 6 0 16 0 52 2 0 1 17 1 16 0 1 6 0 52 5 0 2 17 2 20 7 0 18 0 16 1 48 2 17 3 20 8 0 18 1 16 2 18 0 4 48 4 5 20 9 0 18 1 1 10 0 48 2 5 20 11 0 18 1 16 3 49 2 50)} "compile-begin") :bytecode (16 1 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 135 0 16 1 52 2 0 1 52 4 0 1 17 4 16 1 1 6 0 52 5 0 2 17 5 16 1 1 8 0 52 7 0 2 17 6 52 9 0 0 17 7 52 9 0 0 17 8 51 11 0 1 7 1 8 16 5 52 10 0 2 5 1 14 0 52 13 0 1 16 7 52 9 0 2 16 6 52 12 0 2 17 9 16 4 52 13 0 1 16 9 52 9 0 2 52 9 0 1 17 10 16 4 52 13 0 1 16 8 52 15 0 2 17 11 20 16 0 16 0 16 10 16 11 52 9 0 2 16 2 16 3 49 4 32 71 0 16 1 52 2 0 1 17 4 16 1 52 17 0 1 17 5 20 18 0 16 2 48 1 17 6 16 6 1 20 0 16 2 1 20 0 52 21 0 2 52 19 0 3 5 51 22 0 1 6 1 0 16 4 52 10 0 2 5 20 23 0 16 0 16 5 16 6 16 3 49 4 50)} "compile-letrec" {:upvalue-count 0 :arity 4 :constants ("Compile letrec: all names visible during value compilation.\n 1. Define all local slots (initialized to nil).\n 2. Compile each value and assign — names are already in scope\n so mutually recursive functions can reference each other." "first" "rest" "make-scope" "dict-set!" "next-slot" "get" "map" {:upvalue-count 2 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "scope-define-local" "emit-op" 2 17 "emit-byte") :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 6 0 16 0 52 2 0 1 17 1 20 5 0 18 0 16 1 48 2 17 2 20 6 0 18 1 1 7 0 48 2 5 20 6 0 18 1 1 8 0 48 2 5 20 9 0 18 1 16 2 48 2 5 16 2 50)} "for-each" {:upvalue-count 2 :arity 1 :constants ("first" "nth" 1 "compile-expr" "emit-op" 17 "emit-byte") :bytecode (16 0 52 0 0 1 17 1 16 0 1 2 0 52 1 0 2 17 2 20 3 0 18 0 16 1 1 2 0 52 1 0 2 18 1 4 48 4 5 20 4 0 18 0 1 5 0 48 2 5 20 6 0 18 0 16 2 49 2 50)} {:upvalue-count 2 :arity 1 :constants ("list" "nth") :bytecode (18 0 16 0 52 1 0 2 18 1 16 0 52 1 0 2 52 0 0 2 50)} "range" 0 "len" "compile-begin") :bytecode (1 0 0 5 16 1 52 1 0 1 17 4 16 1 52 2 0 1 17 5 20 3 0 16 2 48 1 17 6 16 6 1 5 0 16 2 1 5 0 52 6 0 2 52 4 0 3 5 51 8 0 1 6 1 0 16 4 52 7 0 2 17 7 51 10 0 1 0 1 6 51 11 0 1 4 1 7 1 13 0 16 4 52 14 0 1 52 12 0 2 52 7 0 2 52 9 0 2 5 20 15 0 16 0 16 5 16 6 16 3 49 4 50)} "compile-lambda" {:upvalue-count 0 :arity 3 :constants ("first" "rest" "make-scope" "make-emitter" "dict-set!" "is-function" "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "symbol" "symbol-name" "list?" "not" "empty?" "first" "&key" "&rest" "scope-define-local") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 9 0 16 0 52 3 0 1 32 61 0 16 0 52 4 0 1 6 33 33 0 5 16 0 52 6 0 1 52 5 0 1 6 33 18 0 5 16 0 52 7 0 1 52 1 0 1 1 2 0 52 0 0 2 33 13 0 16 0 52 7 0 1 52 3 0 1 32 2 0 16 0 17 1 16 1 1 8 0 52 0 0 2 52 5 0 1 6 33 14 0 5 16 1 1 9 0 52 0 0 2 52 5 0 1 33 12 0 20 10 0 18 0 16 1 49 2 32 1 0 2 50)} "compile-begin" "emit-op" 50 "get" "upvalues" "upvalue-count" "len" "arity" "locals" "constants" "pool" "entries" "bytecode" "pool-add" 51 "emit-u16" {:upvalue-count 1 :arity 1 :constants ("emit-byte" "get" "is-local" 1 0 "index") :bytecode (20 0 0 18 0 16 0 1 2 0 52 1 0 2 33 6 0 1 3 0 32 3 0 1 4 0 48 2 5 20 0 0 18 0 16 0 1 5 0 52 1 0 2 49 2 50)}) :bytecode (16 1 52 0 0 1 17 3 16 1 52 1 0 1 17 4 20 2 0 16 2 48 1 17 5 20 3 0 48 0 17 6 16 5 1 5 0 3 52 4 0 3 5 51 7 0 1 5 16 3 52 6 0 2 5 20 8 0 16 6 16 4 16 5 3 48 4 5 20 9 0 16 6 1 10 0 48 2 5 16 5 1 12 0 52 11 0 2 17 7 1 13 0 16 7 52 14 0 1 1 15 0 16 5 1 16 0 52 11 0 2 52 14 0 1 1 17 0 16 6 1 18 0 52 11 0 2 1 19 0 52 11 0 2 1 20 0 16 6 1 20 0 52 11 0 2 65 4 0 17 8 20 21 0 16 0 1 18 0 52 11 0 2 16 8 48 2 17 9 20 9 0 16 0 1 22 0 48 2 5 20 23 0 16 0 16 9 48 2 5 51 24 0 1 0 16 7 52 6 0 2 50)} "compile-define" {:upvalue-count 0 :arity 3 :constants ("first" "=" "type-of" "symbol" "symbol-name" "rest" "not" "empty?" "keyword" {:upvalue-count 1 :arity 1 :constants ("empty?" "=" "type-of" "first" "keyword" "rest") :bytecode (16 0 52 0 0 1 33 4 0 2 32 43 0 16 0 52 3 0 1 52 2 0 1 1 4 0 52 1 0 2 33 17 0 18 0 16 0 52 5 0 1 52 5 0 1 49 1 32 6 0 16 0 52 3 0 1 50)} "nil?" "get" "parent" "scope-define-local" "compile-expr" "emit-op" 17 "emit-byte" "pool-add" "pool" 128 "emit-u16") :bytecode (16 1 52 0 0 1 17 3 16 3 52 2 0 1 1 3 0 52 1 0 2 33 9 0 16 3 52 4 0 1 32 2 0 16 3 17 4 16 1 52 5 0 1 17 6 16 6 52 7 0 1 52 6 0 1 6 33 18 0 5 16 6 52 0 0 1 52 2 0 1 1 8 0 52 1 0 2 33 16 0 51 9 0 1 7 17 7 16 7 16 6 48 1 32 6 0 16 6 52 0 0 1 17 5 16 2 1 12 0 52 11 0 2 52 10 0 1 52 6 0 1 33 47 0 20 13 0 16 2 16 4 48 2 17 6 20 14 0 16 0 16 5 16 2 4 48 4 5 20 15 0 16 0 1 16 0 48 2 5 20 17 0 16 0 16 6 49 2 32 51 0 20 18 0 16 0 1 19 0 52 11 0 2 16 4 48 2 17 6 20 14 0 16 0 16 5 16 2 4 48 4 5 20 15 0 16 0 1 20 0 48 2 5 20 21 0 16 0 16 6 49 2 50)} "compile-set" {:upvalue-count 0 :arity 3 :constants ("=" "type-of" "first" "symbol" "symbol-name" "nth" 1 "scope-resolve" "compile-expr" "get" "type" "local" "emit-op" 17 "emit-byte" "index" "upvalue" 19 "pool-add" "pool" 21 "emit-u16") :bytecode (16 1 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 1 52 2 0 1 52 4 0 1 32 6 0 16 1 52 2 0 1 17 3 16 1 1 6 0 52 5 0 2 17 4 20 7 0 16 2 16 3 48 2 17 5 20 8 0 16 0 16 4 16 2 4 48 4 5 16 5 1 10 0 52 9 0 2 1 11 0 52 0 0 2 33 30 0 20 12 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 5 1 15 0 52 9 0 2 49 2 32 87 0 16 5 1 10 0 52 9 0 2 1 16 0 52 0 0 2 33 30 0 20 12 0 16 0 1 17 0 48 2 5 20 14 0 16 0 16 5 1 15 0 52 9 0 2 49 2 32 38 0 20 18 0 16 0 1 19 0 52 9 0 2 16 3 48 2 17 6 20 12 0 16 0 1 20 0 48 2 5 20 21 0 16 0 16 6 49 2 50)} "compile-quote" {:upvalue-count 0 :arity 2 :constants ("empty?" "emit-op" 2 "emit-const" "first") :bytecode (16 1 52 0 0 1 33 13 0 20 1 0 16 0 1 2 0 49 2 32 13 0 20 3 0 16 0 16 1 52 4 0 1 49 2 50)} "compile-cond" {:upvalue-count 0 :arity 4 :constants ("Compile (cond test1 body1 test2 body2 ... :else fallback)." "<" "len" 2 "emit-op" "first" "nth" 1 ">" "slice" "list" "=" "type-of" "keyword" "keyword-name" "else" "compile-expr" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+" "compile-cond") :bytecode (1 0 0 5 16 1 52 2 0 1 1 3 0 52 1 0 2 33 13 0 20 4 0 16 0 1 3 0 49 2 32 21 1 16 1 52 5 0 1 17 4 16 1 1 7 0 52 6 0 2 17 5 16 1 52 2 0 1 1 3 0 52 8 0 2 33 12 0 16 1 1 3 0 52 9 0 2 32 4 0 52 10 0 0 17 6 16 4 52 12 0 1 1 13 0 52 11 0 2 6 33 14 0 5 16 4 52 14 0 1 1 15 0 52 11 0 2 6 34 8 0 5 16 4 3 52 11 0 2 33 16 0 20 16 0 16 0 16 5 16 2 16 3 49 4 32 162 0 20 16 0 16 0 16 4 16 2 4 48 4 5 20 4 0 16 0 1 17 0 48 2 5 20 18 0 16 0 48 1 17 7 20 19 0 16 0 1 20 0 48 2 5 20 16 0 16 0 16 5 16 2 16 3 48 4 5 20 4 0 16 0 1 21 0 48 2 5 20 18 0 16 0 48 1 17 8 20 19 0 16 0 1 20 0 48 2 5 20 22 0 16 0 16 7 20 18 0 16 0 48 1 16 7 1 3 0 52 24 0 2 52 23 0 2 48 3 5 20 25 0 16 0 16 6 16 2 16 3 48 4 5 20 22 0 16 0 16 8 20 18 0 16 0 48 1 16 8 1 3 0 52 24 0 2 52 23 0 2 49 3 50)} "compile-case" {:upvalue-count 0 :arity 4 :constants ("Compile (case expr val1 body1 val2 body2 ... :else fallback)." "compile-expr" "first" "rest" "compile-case-clauses") :bytecode (1 0 0 5 20 1 0 16 0 16 1 52 2 0 1 16 2 4 48 4 5 16 1 52 3 0 1 17 4 20 4 0 16 0 16 4 16 2 16 3 49 4 50)} "compile-case-clauses" {:upvalue-count 0 :arity 4 :constants ("<" "len" 2 "emit-op" 5 "first" "nth" 1 ">" "slice" "list" "=" "type-of" "keyword" "keyword-name" "else" "compile-expr" 6 "pool-add" "get" "pool" 52 "emit-u16" "emit-byte" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+" "compile-case-clauses") :bytecode (16 1 52 1 0 1 1 2 0 52 0 0 2 33 24 0 20 3 0 16 0 1 4 0 48 2 5 20 3 0 16 0 1 2 0 49 2 32 105 1 16 1 52 5 0 1 17 4 16 1 1 7 0 52 6 0 2 17 5 16 1 52 1 0 1 1 2 0 52 8 0 2 33 12 0 16 1 1 2 0 52 9 0 2 32 4 0 52 10 0 0 17 6 16 4 52 12 0 1 1 13 0 52 11 0 2 6 33 14 0 5 16 4 52 14 0 1 1 15 0 52 11 0 2 6 34 8 0 5 16 4 3 52 11 0 2 33 27 0 20 3 0 16 0 1 4 0 48 2 5 20 16 0 16 0 16 5 16 2 16 3 49 4 32 235 0 20 3 0 16 0 1 17 0 48 2 5 20 16 0 16 0 16 4 16 2 4 48 4 5 20 18 0 16 0 1 20 0 52 19 0 2 1 11 0 48 2 17 7 20 3 0 16 0 1 21 0 48 2 5 20 22 0 16 0 16 7 48 2 5 20 23 0 16 0 1 2 0 48 2 5 20 3 0 16 0 1 24 0 48 2 5 20 25 0 16 0 48 1 17 7 20 26 0 16 0 1 27 0 48 2 5 20 3 0 16 0 1 4 0 48 2 5 20 16 0 16 0 16 5 16 2 16 3 48 4 5 20 3 0 16 0 1 28 0 48 2 5 20 25 0 16 0 48 1 17 8 20 26 0 16 0 1 27 0 48 2 5 20 29 0 16 0 16 7 20 25 0 16 0 48 1 16 7 1 2 0 52 31 0 2 52 30 0 2 48 3 5 20 32 0 16 0 16 6 16 2 16 3 48 4 5 20 29 0 16 0 16 8 20 25 0 16 0 48 1 16 8 1 2 0 52 31 0 2 52 30 0 2 49 3 50)} "compile-match" {:upvalue-count 0 :arity 4 :constants ("compile-expr" "first" {:upvalue-count 4 :arity 1 :constants ("empty?" "emit-op" 5 "pool-add" "get" "pool" "match: no clause matched" 1 "emit-u16" 52 "error" "emit-byte" "first" "nth" "rest" "=" "type-of" "symbol" "symbol-name" "_" "compile-expr" "not" "true" "false" "nil" "scope-add" 13 "scope-index" "list?" "len" 2 "quote" 6 "make-symbol" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+") :bytecode (16 0 52 0 0 1 33 100 0 20 1 0 18 0 1 2 0 48 2 5 20 3 0 18 0 1 5 0 52 4 0 2 1 6 0 48 2 17 1 20 1 0 18 0 1 7 0 48 2 5 20 8 0 18 0 16 1 48 2 5 20 1 0 18 0 1 9 0 48 2 5 20 8 0 18 0 20 3 0 18 0 1 5 0 52 4 0 2 1 10 0 48 2 48 2 5 20 11 0 18 0 1 7 0 49 2 32 69 3 16 0 52 12 0 1 17 1 16 1 52 12 0 1 17 2 16 1 1 7 0 52 13 0 2 17 3 16 0 52 14 0 1 17 4 16 2 52 16 0 1 1 17 0 52 15 0 2 6 33 14 0 5 16 2 52 18 0 1 1 19 0 52 15 0 2 33 27 0 20 1 0 18 0 1 2 0 48 2 5 20 20 0 18 0 16 3 18 1 18 2 49 4 32 229 2 16 2 52 16 0 1 1 17 0 52 15 0 2 6 33 62 0 5 16 2 52 18 0 1 1 22 0 52 15 0 2 52 21 0 1 6 33 40 0 5 16 2 52 18 0 1 1 23 0 52 15 0 2 52 21 0 1 6 33 18 0 5 16 2 52 18 0 1 1 24 0 52 15 0 2 52 21 0 1 33 63 0 16 2 52 18 0 1 17 5 20 25 0 18 1 16 5 48 2 17 6 20 1 0 18 0 1 26 0 48 2 5 20 11 0 18 0 20 27 0 16 6 16 5 48 2 48 2 5 20 20 0 18 0 16 3 16 6 18 2 49 4 32 84 2 16 2 52 28 0 1 6 33 83 0 5 16 2 52 29 0 1 1 30 0 52 15 0 2 6 33 65 0 5 16 2 52 12 0 1 52 16 0 1 1 17 0 52 15 0 2 6 33 43 0 5 16 2 52 12 0 1 52 18 0 1 1 31 0 52 15 0 2 6 33 21 0 5 16 2 1 7 0 52 13 0 2 52 16 0 1 1 17 0 52 15 0 2 33 16 1 20 1 0 18 0 1 32 0 48 2 5 20 3 0 18 0 1 5 0 52 4 0 2 16 2 1 7 0 52 13 0 2 52 18 0 1 52 33 0 1 48 2 17 5 20 1 0 18 0 1 7 0 48 2 5 20 8 0 18 0 16 5 48 2 5 20 3 0 18 0 1 5 0 52 4 0 2 1 15 0 48 2 17 5 20 1 0 18 0 1 9 0 48 2 5 20 8 0 18 0 16 5 48 2 5 20 11 0 18 0 1 30 0 48 2 5 20 1 0 18 0 1 34 0 48 2 5 20 35 0 18 0 48 1 17 5 20 36 0 18 0 1 37 0 48 2 5 20 1 0 18 0 1 2 0 48 2 5 20 20 0 18 0 16 3 18 1 18 2 48 4 5 20 1 0 18 0 1 38 0 48 2 5 20 35 0 18 0 48 1 17 6 20 36 0 18 0 1 37 0 48 2 5 20 39 0 18 0 16 5 20 35 0 18 0 48 1 16 5 1 30 0 52 41 0 2 52 40 0 2 48 3 5 18 3 16 4 48 1 5 20 39 0 18 0 16 6 20 35 0 18 0 48 1 16 6 1 30 0 52 41 0 2 52 40 0 2 49 3 32 228 0 20 1 0 18 0 1 32 0 48 2 5 20 20 0 18 0 16 2 18 1 4 48 4 5 20 3 0 18 0 1 5 0 52 4 0 2 1 15 0 48 2 17 5 20 1 0 18 0 1 9 0 48 2 5 20 8 0 18 0 16 5 48 2 5 20 11 0 18 0 1 30 0 48 2 5 20 1 0 18 0 1 34 0 48 2 5 20 35 0 18 0 48 1 17 5 20 36 0 18 0 1 37 0 48 2 5 20 1 0 18 0 1 2 0 48 2 5 20 20 0 18 0 16 3 18 1 18 2 48 4 5 20 1 0 18 0 1 38 0 48 2 5 20 35 0 18 0 48 1 17 6 20 36 0 18 0 1 37 0 48 2 5 20 39 0 18 0 16 5 20 35 0 18 0 48 1 16 5 1 30 0 52 41 0 2 52 40 0 2 48 3 5 18 3 16 4 48 1 5 20 39 0 18 0 16 6 20 35 0 18 0 48 1 16 6 1 30 0 52 41 0 2 52 40 0 2 49 3 50)} "rest") :bytecode (20 0 0 16 0 16 1 52 1 0 1 16 2 4 48 4 5 2 17 4 51 2 0 1 0 1 2 1 3 1 4 17 4 16 4 16 1 52 3 0 1 49 1 50)} "compile-thread" {:upvalue-count 0 :arity 4 :constants ("Compile (-> val (f1 a) (f2 b)) by desugaring to nested calls." "empty?" "emit-op" 2 "=" "len" 1 "compile-expr" "first" "rest" "compile-thread-step") :bytecode (1 0 0 5 16 1 52 1 0 1 33 13 0 20 2 0 16 0 1 3 0 49 2 32 67 0 16 1 52 5 0 1 1 6 0 52 4 0 2 33 20 0 20 7 0 16 0 16 1 52 8 0 1 16 2 16 3 49 4 32 31 0 16 1 52 8 0 1 17 4 16 1 52 9 0 1 17 5 20 10 0 16 0 16 4 16 5 16 2 16 3 49 5 50)} "compile-thread-step" {:upvalue-count 0 :arity 5 :constants ("empty?" "compile-expr" "first" "rest" "list?" "concat" "list" "compile-thread-step") :bytecode (16 2 52 0 0 1 33 16 0 20 1 0 16 0 16 1 16 3 16 4 49 4 32 128 0 16 2 52 2 0 1 17 5 16 2 52 3 0 1 17 6 16 4 6 33 7 0 5 16 6 52 0 0 1 17 7 16 5 52 4 0 1 33 25 0 16 5 52 2 0 1 16 1 52 6 0 2 16 5 52 3 0 1 52 5 0 2 32 8 0 16 5 16 1 52 6 0 2 17 8 16 6 52 0 0 1 33 16 0 20 1 0 16 0 16 8 16 3 16 7 49 4 32 28 0 20 1 0 16 0 16 8 16 3 4 48 4 5 20 7 0 16 0 16 8 16 6 16 3 16 4 49 5 50)} "compile-defcomp" {:upvalue-count 0 :arity 3 :constants ("Compile defcomp/defisland — delegates to runtime via GLOBAL_GET + CALL." "pool-add" "get" "pool" "eval-defcomp" "emit-op" 20 "emit-u16" "emit-const" "concat" "list" "make-symbol" "defcomp" 48 "emit-byte" 1) :bytecode (1 0 0 5 20 1 0 16 0 1 3 0 52 2 0 2 1 4 0 48 2 17 3 20 5 0 16 0 1 6 0 48 2 5 20 7 0 16 0 16 3 48 2 5 20 8 0 16 0 1 12 0 52 11 0 1 52 10 0 1 16 1 52 9 0 2 48 2 5 20 5 0 16 0 1 13 0 48 2 5 20 14 0 16 0 1 15 0 49 2 50)} "compile-defmacro" {:upvalue-count 0 :arity 3 :constants ("Compile defmacro — delegates to runtime via GLOBAL_GET + CALL." "pool-add" "get" "pool" "eval-defmacro" "emit-op" 20 "emit-u16" "emit-const" "concat" "list" "make-symbol" "defmacro" 48 "emit-byte" 1) :bytecode (1 0 0 5 20 1 0 16 0 1 3 0 52 2 0 2 1 4 0 48 2 17 3 20 5 0 16 0 1 6 0 48 2 5 20 7 0 16 0 16 3 48 2 5 20 8 0 16 0 1 12 0 52 11 0 1 52 10 0 1 16 1 52 9 0 2 48 2 5 20 5 0 16 0 1 13 0 48 2 5 20 14 0 16 0 1 15 0 49 2 50)} "compile-quasiquote" {:upvalue-count 0 :arity 3 :constants ("Compile quasiquote inline — walks the template at compile time,\n emitting code that builds the structure at runtime. Unquoted\n expressions are compiled normally (resolving locals/upvalues),\n avoiding the qq-expand-runtime env-lookup limitation." "compile-qq-expr") :bytecode (1 0 0 5 20 1 0 16 0 16 1 16 2 49 3 50)} "compile-qq-expr" {:upvalue-count 0 :arity 3 :constants ("Compile a quasiquote sub-expression." "not" "=" "type-of" "list" "emit-const" "empty?" "emit-op" 64 "emit-u16" 0 "first" "symbol" "symbol-name" "unquote" "compile-expr" "nth" 1 "compile-qq-list") :bytecode (1 0 0 5 16 1 52 3 0 1 1 4 0 52 2 0 2 52 1 0 1 33 12 0 20 5 0 16 0 16 1 49 2 32 108 0 16 1 52 6 0 1 33 24 0 20 7 0 16 0 1 8 0 48 2 5 20 9 0 16 0 1 10 0 49 2 32 75 0 16 1 52 11 0 1 17 3 16 3 52 3 0 1 1 12 0 52 2 0 2 6 33 14 0 5 16 3 52 13 0 1 1 14 0 52 2 0 2 33 22 0 20 15 0 16 0 16 1 1 17 0 52 16 0 2 16 2 4 49 4 32 11 0 20 18 0 16 0 16 1 16 2 49 3 50)} "compile-qq-list" {:upvalue-count 0 :arity 3 :constants ("Compile a quasiquote list. Handles splice-unquote by building\n segments and concatenating them." "some" {:upvalue-count 0 :arity 1 :constants ("=" "type-of" "list" ">=" "len" 2 "first" "symbol" "symbol-name" "splice-unquote") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 58 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 40 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 18 0 5 16 0 52 6 0 1 52 8 0 1 1 9 0 52 0 0 2 50)} "not" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-qq-expr") :bytecode (20 0 0 18 0 16 0 18 1 49 3 50)} "emit-op" 64 "emit-u16" "len" 0 {:upvalue-count 4 :arity 1 :constants ("=" "type-of" "list" ">=" "len" 2 "first" "symbol" "symbol-name" "splice-unquote" ">" 0 "emit-op" 64 "emit-u16" "+" 1 "compile-expr" "nth" "compile-qq-expr") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 58 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 40 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 18 0 5 16 0 52 6 0 1 52 8 0 1 1 9 0 52 0 0 2 33 89 0 18 0 1 11 0 52 10 0 2 33 41 0 20 12 0 18 1 1 13 0 48 2 5 20 14 0 18 1 18 0 48 2 5 18 2 1 16 0 52 15 0 2 19 2 5 1 11 0 19 0 32 1 0 2 5 20 17 0 18 1 16 0 1 16 0 52 18 0 2 18 3 4 48 4 5 18 2 1 16 0 52 15 0 2 19 2 32 23 0 20 19 0 18 1 16 0 18 3 48 3 5 18 0 1 16 0 52 15 0 2 19 0 50)} ">" "+" 1 "pool-add" "get" "pool" "concat" 52 "emit-byte") :bytecode (1 0 0 5 51 2 0 16 1 52 1 0 2 17 3 16 3 52 3 0 1 33 41 0 51 5 0 1 0 1 2 16 1 52 4 0 2 5 20 6 0 16 0 1 7 0 48 2 5 20 8 0 16 0 16 1 52 9 0 1 49 2 32 142 0 1 10 0 17 4 1 10 0 17 5 51 11 0 1 5 1 0 1 4 1 2 16 1 52 4 0 2 5 16 5 1 10 0 52 12 0 2 33 35 0 20 6 0 16 0 1 7 0 48 2 5 20 8 0 16 0 16 5 48 2 5 16 4 1 14 0 52 13 0 2 17 4 32 1 0 2 5 16 4 1 14 0 52 12 0 2 33 52 0 20 15 0 16 0 1 17 0 52 16 0 2 1 18 0 48 2 17 6 20 6 0 16 0 1 19 0 48 2 5 20 8 0 16 0 16 6 48 2 5 20 20 0 16 0 16 4 49 2 32 1 0 2 50)} "compile-call" {:upvalue-count 0 :arity 5 :constants ("=" "type-of" "symbol" "symbol-name" "not" "get" "scope-resolve" "type" "local" "upvalue" "primitive?" "len" "pool-add" "pool" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-expr") :bytecode (20 0 0 18 0 16 0 18 1 4 49 4 50)} "emit-op" 52 "emit-u16" "emit-byte" "compile-expr" 49 48) :bytecode (16 1 52 1 0 1 1 2 0 52 0 0 2 6 33 79 0 5 16 1 52 3 0 1 17 6 20 6 0 16 3 16 6 48 2 1 7 0 52 5 0 2 1 8 0 52 0 0 2 52 4 0 1 6 33 39 0 5 20 6 0 16 3 16 6 48 2 1 7 0 52 5 0 2 1 9 0 52 0 0 2 52 4 0 1 6 33 7 0 5 16 6 52 10 0 1 17 5 16 5 33 81 0 16 1 52 3 0 1 17 6 16 2 52 11 0 1 17 7 20 12 0 16 0 1 13 0 52 5 0 2 16 6 48 2 17 8 51 15 0 1 0 1 3 16 2 52 14 0 2 5 20 16 0 16 0 1 17 0 48 2 5 20 18 0 16 0 16 8 48 2 5 20 19 0 16 0 16 7 49 2 32 83 0 20 20 0 16 0 16 1 16 3 4 48 4 5 51 15 0 1 0 1 3 16 2 52 14 0 2 5 16 4 33 27 0 20 16 0 16 0 1 21 0 48 2 5 20 19 0 16 0 16 2 52 11 0 1 49 2 32 24 0 20 16 0 16 0 1 22 0 48 2 5 20 19 0 16 0 16 2 52 11 0 1 49 2 50)} "compile" {:upvalue-count 0 :arity 1 :constants ("Compile a single SX expression to a bytecode module." "make-emitter" "make-scope" "compile-expr" "emit-op" 50 "constants" "get" "pool" "entries" "bytecode") :bytecode (1 0 0 5 20 1 0 48 0 17 1 20 2 0 2 48 1 17 2 20 3 0 16 1 16 0 16 2 4 48 4 5 20 4 0 16 1 1 5 0 48 2 5 1 6 0 16 1 1 8 0 52 7 0 2 1 9 0 52 7 0 2 1 10 0 16 1 1 10 0 52 7 0 2 65 2 0 50)} "compile-module" {:upvalue-count 0 :arity 1 :constants ("Compile a list of top-level expressions to a bytecode module." "make-emitter" "make-scope" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-expr" "emit-op" 5) :bytecode (20 0 0 18 0 16 0 18 1 4 48 4 5 20 1 0 18 0 1 2 0 49 2 50)} "init" "compile-expr" "last" "emit-op" 50 "constants" "get" "pool" "entries" "bytecode") :bytecode (1 0 0 5 20 1 0 48 0 17 1 20 2 0 2 48 1 17 2 51 4 0 1 1 1 2 16 0 52 5 0 1 52 3 0 2 5 20 6 0 16 1 16 0 52 7 0 1 16 2 4 48 4 5 20 8 0 16 1 1 9 0 48 2 5 1 10 0 16 1 1 12 0 52 11 0 2 1 13 0 52 11 0 2 1 14 0 16 1 1 14 0 52 11 0 2 65 2 0 50)} {:library (sx compiler) :op "import"}) :bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 41 0 128 40 0 5 51 43 0 128 42 0 5 51 45 0 128 44 0 5 51 47 0 128 46 0 5 51 49 0 128 48 0 5 51 51 0 128 50 0 5 51 53 0 128 52 0 5 51 55 0 128 54 0 5 51 57 0 128 56 0 5 51 59 0 128 58 0 5 51 61 0 128 60 0 5 51 63 0 128 62 0 5 51 65 0 128 64 0 5 51 67 0 128 66 0 5 51 69 0 128 68 0 5 51 71 0 128 70 0 5 51 73 0 128 72 0 5 51 75 0 128 74 0 5 51 77 0 128 76 0 5 51 79 0 128 78 0 5 51 81 0 128 80 0 5 51 83 0 128 82 0 5 1 84 0 112 50))) + :constants ("make-pool" {:upvalue-count 0 :arity 0 :constants ("entries" "primitive?" "mutable-list" "list" "index" "_count" 0) :bytecode (1 0 0 1 2 0 52 1 0 1 33 7 0 52 2 0 0 32 4 0 52 3 0 0 1 4 0 1 5 0 1 6 0 65 1 0 65 2 0 50)} "pool-add" {:upvalue-count 0 :arity 2 :constants ("Add a value to the constant pool, return its index. Deduplicates." "serialize" "get" "index" "has-key?" "_count" "dict-set!" "+" 1 "append!" "entries") :bytecode (1 0 0 5 16 1 52 1 0 1 17 2 16 0 1 3 0 52 2 0 2 17 3 16 3 16 2 52 4 0 2 33 11 0 16 3 16 2 52 2 0 2 32 59 0 16 3 1 5 0 52 2 0 2 17 4 16 3 16 2 16 4 52 6 0 3 5 16 3 1 5 0 16 4 1 8 0 52 7 0 2 52 6 0 3 5 16 0 1 10 0 52 2 0 2 16 1 52 9 0 2 5 16 4 50)} "make-scope" {:upvalue-count 0 :arity 1 :constants ("next-slot" 0 "upvalues" "list" "locals" "parent" "is-function") :bytecode (1 0 0 1 1 0 1 2 0 52 3 0 0 1 4 0 52 3 0 0 1 5 0 16 0 1 6 0 4 65 5 0 50)} "scope-define-local" {:upvalue-count 0 :arity 2 :constants ("Add a local variable, return its slot index.\n Idempotent: if name already has a slot, return it." "first" "filter" {:upvalue-count 1 :arity 1 :constants ("=" "get" "name") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "get" "locals" "slot" "next-slot" "append!" "mutable" "name" "dict-set!" "+" 1) :bytecode (1 0 0 5 51 3 0 1 1 16 0 1 5 0 52 4 0 2 52 2 0 2 52 1 0 1 17 2 16 2 33 12 0 16 2 1 6 0 52 4 0 2 32 63 0 16 0 1 7 0 52 4 0 2 17 3 16 0 1 5 0 52 4 0 2 1 9 0 4 1 6 0 16 3 1 10 0 16 1 65 3 0 52 8 0 2 5 16 0 1 7 0 16 3 1 13 0 52 12 0 2 52 11 0 3 5 16 3 50)} "scope-resolve" {:upvalue-count 0 :arity 2 :constants ("Resolve a variable name. Returns {:type \"local\"|\"upvalue\"|\"global\", :index N}.\n Upvalue captures only happen at function boundaries (is-function=true).\n Let scopes share the enclosing function's frame — their locals are\n accessed directly without upvalue indirection." "nil?" "index" "type" "global" "get" "locals" "some" {:upvalue-count 1 :arity 1 :constants ("=" "get" "name") :bytecode (16 0 1 2 0 52 1 0 2 18 0 52 0 0 2 50)} "first" "filter" "slot" "local" "upvalues" "uv-index" "upvalue" "parent" "scope-resolve" "=" "is-function" "len" "append!" "is-local" "name") :bytecode (1 0 0 5 16 0 52 1 0 1 33 17 0 1 2 0 16 1 1 3 0 1 4 0 65 2 0 32 60 1 16 0 1 6 0 52 5 0 2 17 2 51 8 0 1 1 16 2 52 7 0 2 17 3 16 3 33 41 0 51 8 0 1 1 16 2 52 10 0 2 52 9 0 1 17 4 1 2 0 16 4 1 11 0 52 5 0 2 1 3 0 1 12 0 65 2 0 32 246 0 16 0 1 13 0 52 5 0 2 17 4 51 8 0 1 1 16 4 52 7 0 2 17 5 16 5 33 41 0 51 8 0 1 1 16 4 52 10 0 2 52 9 0 1 17 6 1 2 0 16 6 1 14 0 52 5 0 2 1 3 0 1 15 0 65 2 0 32 176 0 16 0 1 16 0 52 5 0 2 17 6 16 6 52 1 0 1 33 17 0 1 2 0 16 1 1 3 0 1 4 0 65 2 0 32 139 0 20 17 0 16 6 16 1 48 2 17 7 16 7 1 3 0 52 5 0 2 1 4 0 52 18 0 2 33 5 0 16 7 32 104 0 16 0 1 19 0 52 5 0 2 33 90 0 16 0 1 13 0 52 5 0 2 52 20 0 1 17 8 16 0 1 13 0 52 5 0 2 1 2 0 16 7 1 2 0 52 5 0 2 1 22 0 16 7 1 3 0 52 5 0 2 1 12 0 52 18 0 2 1 14 0 16 8 1 23 0 16 1 65 4 0 52 21 0 2 5 1 2 0 16 8 1 3 0 1 15 0 65 2 0 32 2 0 16 7 50)} "make-emitter" {:upvalue-count 0 :arity 0 :constants ("pool" "make-pool" "bytecode" "primitive?" "mutable-list" "list") :bytecode (1 0 0 20 1 0 48 0 1 2 0 1 4 0 52 3 0 1 33 7 0 52 4 0 0 32 4 0 52 5 0 0 65 2 0 50)} "emit-byte" {:upvalue-count 0 :arity 2 :constants ("append!" "get" "bytecode") :bytecode (16 0 1 2 0 52 1 0 2 16 1 52 0 0 2 50)} "emit-u16" {:upvalue-count 0 :arity 2 :constants ("emit-byte" "mod" 256 "floor" "/") :bytecode (20 0 0 16 0 16 1 1 2 0 52 1 0 2 48 2 5 20 0 0 16 0 16 1 1 2 0 52 4 0 2 52 3 0 1 1 2 0 52 1 0 2 49 2 50)} "emit-i16" {:upvalue-count 0 :arity 2 :constants ("<" 0 "+" 65536 "emit-u16") :bytecode (16 1 1 1 0 52 0 0 2 33 12 0 16 1 1 3 0 52 2 0 2 32 2 0 16 1 17 2 20 4 0 16 0 16 2 49 2 50)} "emit-op" {:upvalue-count 0 :arity 2 :constants ("emit-byte") :bytecode (20 0 0 16 0 16 1 49 2 50)} "emit-const" {:upvalue-count 0 :arity 2 :constants ("pool-add" "get" "pool" "emit-op" 1 "emit-u16") :bytecode (20 0 0 16 0 1 2 0 52 1 0 2 16 1 48 2 17 2 20 3 0 16 0 1 4 0 48 2 5 20 5 0 16 0 16 2 49 2 50)} "current-offset" {:upvalue-count 0 :arity 1 :constants ("len" "get" "bytecode") :bytecode (16 0 1 2 0 52 1 0 2 52 0 0 1 50)} "patch-i16" {:upvalue-count 0 :arity 3 :constants ("Patch a previously emitted i16 at the given bytecode offset." "<" 0 "+" 65536 "get" "bytecode" "set-nth!" "mod" 256 1 "floor" "/") :bytecode (1 0 0 5 16 2 1 2 0 52 1 0 2 33 12 0 16 2 1 4 0 52 3 0 2 32 2 0 16 2 17 3 16 0 1 6 0 52 5 0 2 17 4 16 4 16 1 16 3 1 9 0 52 8 0 2 52 7 0 3 5 16 4 16 1 1 10 0 52 3 0 2 16 3 1 9 0 52 12 0 2 52 11 0 1 1 9 0 52 8 0 2 52 7 0 3 50)} "compile-expr" {:upvalue-count 0 :arity 4 :constants ("Compile an expression. tail? indicates tail position for TCO." "nil?" "emit-op" 2 "=" "type-of" "number" "emit-const" "string" "boolean" 3 4 "keyword" "keyword-name" "symbol" "compile-symbol" "symbol-name" "list" "empty?" 64 "emit-u16" 0 "compile-list" "dict" "compile-dict") :bytecode (1 0 0 5 16 1 52 1 0 1 33 13 0 20 2 0 16 0 1 3 0 49 2 32 10 1 16 1 52 5 0 1 1 6 0 52 4 0 2 33 12 0 20 7 0 16 0 16 1 49 2 32 238 0 16 1 52 5 0 1 1 8 0 52 4 0 2 33 12 0 20 7 0 16 0 16 1 49 2 32 210 0 16 1 52 5 0 1 1 9 0 52 4 0 2 33 24 0 20 2 0 16 0 16 1 33 6 0 1 10 0 32 3 0 1 11 0 49 2 32 170 0 16 1 52 5 0 1 1 12 0 52 4 0 2 33 16 0 20 7 0 16 0 16 1 52 13 0 1 49 2 32 138 0 16 1 52 5 0 1 1 14 0 52 4 0 2 33 18 0 20 15 0 16 0 16 1 52 16 0 1 16 2 49 3 32 104 0 16 1 52 5 0 1 1 17 0 52 4 0 2 33 49 0 16 1 52 18 0 1 33 24 0 20 2 0 16 0 1 19 0 48 2 5 20 20 0 16 0 1 21 0 49 2 32 13 0 20 22 0 16 0 16 1 16 2 16 3 49 4 32 39 0 16 1 52 5 0 1 1 23 0 52 4 0 2 33 14 0 20 24 0 16 0 16 1 16 2 49 3 32 9 0 20 7 0 16 0 16 1 49 2 50)} "compile-symbol" {:upvalue-count 0 :arity 3 :constants ("scope-resolve" "=" "get" "type" "local" "emit-op" 16 "emit-byte" "index" "upvalue" 18 "pool-add" "pool" 20 "emit-u16") :bytecode (20 0 0 16 2 16 1 48 2 17 3 16 3 1 3 0 52 2 0 2 1 4 0 52 1 0 2 33 30 0 20 5 0 16 0 1 6 0 48 2 5 20 7 0 16 0 16 3 1 8 0 52 2 0 2 49 2 32 87 0 16 3 1 3 0 52 2 0 2 1 9 0 52 1 0 2 33 30 0 20 5 0 16 0 1 10 0 48 2 5 20 7 0 16 0 16 3 1 8 0 52 2 0 2 49 2 32 38 0 20 11 0 16 0 1 12 0 52 2 0 2 16 1 48 2 17 4 20 5 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 4 49 2 50)} "compile-dict" {:upvalue-count 0 :arity 3 :constants ("keys" "len" "for-each" {:upvalue-count 3 :arity 1 :constants ("emit-const" "compile-expr" "get") :bytecode (20 0 0 18 0 16 0 48 2 5 20 1 0 18 0 18 1 16 0 52 2 0 2 18 2 4 49 4 50)} "emit-op" 65 "emit-u16") :bytecode (16 1 52 0 0 1 17 3 16 3 52 1 0 1 17 4 51 3 0 1 0 1 1 1 2 16 3 52 2 0 2 5 20 4 0 16 0 1 5 0 48 2 5 20 6 0 16 0 16 4 49 2 50)} "compile-list" {:upvalue-count 0 :arity 4 :constants ("first" "rest" "not" "=" "type-of" "symbol" "compile-call" "symbol-name" "if" "compile-if" "when" "compile-when" "and" "compile-and" "or" "compile-or" "let" "compile-let" "let*" "let-match" "desugar-let-match" "begin" "compile-begin" "do" "lambda" "compile-lambda" "fn" "define" "compile-define" "set!" "compile-set" "quote" "compile-quote" "cond" "compile-cond" "case" "compile-case" "->" "compile-thread" "defcomp" "compile-defcomp" "defisland" "defmacro" "compile-defmacro" "defstyle" "emit-op" 2 "defhandler" "defpage" "defquery" "defaction" "defrelation" "deftype" "defeffect" "quasiquote" "compile-quasiquote" "letrec" "compile-letrec" "match" "compile-match" "perform" "compile-expr" 112 "import" "emit-const" "library" "op" "define-library" "filter" {:upvalue-count 0 :arity 1 :constants ("list?" "not" "empty?" "=" "first" begin) :bytecode (16 0 52 0 0 1 6 33 29 0 5 16 0 52 2 0 1 52 1 0 1 6 33 14 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 50)} "empty?" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-expr" "emit-op" 5) :bytecode (20 0 0 18 0 16 0 18 1 4 48 4 5 20 1 0 18 0 1 2 0 49 2 50)} "init" "last") :bytecode (16 1 52 0 0 1 17 4 16 1 52 1 0 1 17 5 16 4 52 4 0 1 1 5 0 52 3 0 2 52 2 0 1 33 18 0 20 6 0 16 0 16 4 16 5 16 2 16 3 49 5 32 60 4 16 4 52 7 0 1 17 6 16 6 1 8 0 52 3 0 2 33 16 0 20 9 0 16 0 16 5 16 2 16 3 49 4 32 24 4 16 6 1 10 0 52 3 0 2 33 16 0 20 11 0 16 0 16 5 16 2 16 3 49 4 32 252 3 16 6 1 12 0 52 3 0 2 33 16 0 20 13 0 16 0 16 5 16 2 16 3 49 4 32 224 3 16 6 1 14 0 52 3 0 2 33 16 0 20 15 0 16 0 16 5 16 2 16 3 49 4 32 196 3 16 6 1 16 0 52 3 0 2 33 16 0 20 17 0 16 0 16 5 16 2 16 3 49 4 32 168 3 16 6 1 18 0 52 3 0 2 33 16 0 20 17 0 16 0 16 5 16 2 16 3 49 4 32 140 3 16 6 1 19 0 52 3 0 2 33 21 0 20 17 0 16 0 20 20 0 16 5 48 1 16 2 16 3 49 4 32 107 3 16 6 1 21 0 52 3 0 2 33 16 0 20 22 0 16 0 16 5 16 2 16 3 49 4 32 79 3 16 6 1 23 0 52 3 0 2 33 16 0 20 22 0 16 0 16 5 16 2 16 3 49 4 32 51 3 16 6 1 24 0 52 3 0 2 33 14 0 20 25 0 16 0 16 5 16 2 49 3 32 25 3 16 6 1 26 0 52 3 0 2 33 14 0 20 25 0 16 0 16 5 16 2 49 3 32 255 2 16 6 1 27 0 52 3 0 2 33 14 0 20 28 0 16 0 16 5 16 2 49 3 32 229 2 16 6 1 29 0 52 3 0 2 33 14 0 20 30 0 16 0 16 5 16 2 49 3 32 203 2 16 6 1 31 0 52 3 0 2 33 12 0 20 32 0 16 0 16 5 49 2 32 179 2 16 6 1 33 0 52 3 0 2 33 16 0 20 34 0 16 0 16 5 16 2 16 3 49 4 32 151 2 16 6 1 35 0 52 3 0 2 33 16 0 20 36 0 16 0 16 5 16 2 16 3 49 4 32 123 2 16 6 1 37 0 52 3 0 2 33 16 0 20 38 0 16 0 16 5 16 2 16 3 49 4 32 95 2 16 6 1 39 0 52 3 0 2 33 14 0 20 40 0 16 0 16 5 16 2 49 3 32 69 2 16 6 1 41 0 52 3 0 2 33 14 0 20 40 0 16 0 16 5 16 2 49 3 32 43 2 16 6 1 42 0 52 3 0 2 33 14 0 20 43 0 16 0 16 5 16 2 49 3 32 17 2 16 6 1 44 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 246 1 16 6 1 47 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 219 1 16 6 1 48 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 192 1 16 6 1 49 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 165 1 16 6 1 50 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 138 1 16 6 1 51 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 111 1 16 6 1 52 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 84 1 16 6 1 53 0 52 3 0 2 33 15 0 20 45 0 16 0 1 46 0 48 2 5 2 32 57 1 16 6 1 41 0 52 3 0 2 33 14 0 20 40 0 16 0 16 5 16 2 49 3 32 31 1 16 6 1 54 0 52 3 0 2 33 18 0 20 55 0 16 0 16 5 52 0 0 1 16 2 49 3 32 1 1 16 6 1 56 0 52 3 0 2 33 16 0 20 57 0 16 0 16 5 16 2 16 3 49 4 32 229 0 16 6 1 58 0 52 3 0 2 33 16 0 20 59 0 16 0 16 5 16 2 16 3 49 4 32 201 0 16 6 1 60 0 52 3 0 2 33 32 0 20 61 0 16 0 16 5 52 0 0 1 16 2 4 48 4 5 20 45 0 16 0 1 62 0 48 2 5 2 32 157 0 16 6 1 63 0 52 3 0 2 33 41 0 20 64 0 16 0 1 65 0 16 5 52 0 0 1 1 66 0 1 63 0 65 2 0 48 2 5 20 45 0 16 0 1 62 0 48 2 5 2 32 104 0 16 6 1 67 0 52 3 0 2 33 77 0 51 69 0 16 5 52 68 0 2 17 7 16 7 52 70 0 1 52 2 0 1 33 49 0 16 7 52 0 0 1 52 1 0 1 17 8 51 72 0 1 0 1 2 16 8 52 73 0 1 52 71 0 2 5 20 61 0 16 0 16 8 52 74 0 1 16 2 4 49 4 32 1 0 2 32 15 0 20 6 0 16 0 16 4 16 5 16 2 16 3 49 5 50)} "compile-if" {:upvalue-count 0 :arity 4 :constants ("first" "nth" 1 ">" "len" 2 "compile-expr" "emit-op" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+" "nil?") :bytecode (16 1 52 0 0 1 17 4 16 1 1 2 0 52 1 0 2 17 5 16 1 52 4 0 1 1 5 0 52 3 0 2 33 12 0 16 1 1 5 0 52 1 0 2 32 1 0 2 17 6 20 6 0 16 0 16 4 16 2 4 48 4 5 20 7 0 16 0 1 8 0 48 2 5 20 9 0 16 0 48 1 17 7 20 10 0 16 0 1 11 0 48 2 5 20 6 0 16 0 16 5 16 2 16 3 48 4 5 20 7 0 16 0 1 12 0 48 2 5 20 9 0 16 0 48 1 17 8 20 10 0 16 0 1 11 0 48 2 5 20 13 0 16 0 16 7 20 9 0 16 0 48 1 16 7 1 5 0 52 15 0 2 52 14 0 2 48 3 5 16 6 52 16 0 1 33 13 0 20 7 0 16 0 1 5 0 48 2 32 13 0 20 6 0 16 0 16 6 16 2 16 3 48 4 5 20 13 0 16 0 16 8 20 9 0 16 0 48 1 16 8 1 5 0 52 15 0 2 52 14 0 2 49 3 50)} "compile-when" {:upvalue-count 0 :arity 4 :constants ("first" "rest" "compile-expr" "emit-op" 33 "current-offset" "emit-i16" 0 "compile-begin" 32 "patch-i16" "-" "+" 2) :bytecode (16 1 52 0 0 1 17 4 16 1 52 1 0 1 17 5 20 2 0 16 0 16 4 16 2 4 48 4 5 20 3 0 16 0 1 4 0 48 2 5 20 5 0 16 0 48 1 17 6 20 6 0 16 0 1 7 0 48 2 5 20 8 0 16 0 16 5 16 2 16 3 48 4 5 20 3 0 16 0 1 9 0 48 2 5 20 5 0 16 0 48 1 17 7 20 6 0 16 0 1 7 0 48 2 5 20 10 0 16 0 16 6 20 5 0 16 0 48 1 16 6 1 13 0 52 12 0 2 52 11 0 2 48 3 5 20 3 0 16 0 1 13 0 48 2 5 20 10 0 16 0 16 7 20 5 0 16 0 48 1 16 7 1 13 0 52 12 0 2 52 11 0 2 49 3 50)} "compile-and" {:upvalue-count 0 :arity 4 :constants ("empty?" "emit-op" 3 "=" "len" 1 "compile-expr" "first" 6 33 "current-offset" "emit-i16" 0 5 "compile-and" "rest" "patch-i16" "-" "+" 2) :bytecode (16 1 52 0 0 1 33 13 0 20 1 0 16 0 1 2 0 49 2 32 153 0 16 1 52 4 0 1 1 5 0 52 3 0 2 33 20 0 20 6 0 16 0 16 1 52 7 0 1 16 2 16 3 49 4 32 117 0 20 6 0 16 0 16 1 52 7 0 1 16 2 4 48 4 5 20 1 0 16 0 1 8 0 48 2 5 20 1 0 16 0 1 9 0 48 2 5 20 10 0 16 0 48 1 17 4 20 11 0 16 0 1 12 0 48 2 5 20 1 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 1 52 15 0 1 16 2 16 3 48 4 5 20 16 0 16 0 16 4 20 10 0 16 0 48 1 16 4 1 19 0 52 18 0 2 52 17 0 2 49 3 50)} "compile-or" {:upvalue-count 0 :arity 4 :constants ("empty?" "emit-op" 4 "=" "len" 1 "compile-expr" "first" 6 34 "current-offset" "emit-i16" 0 5 "compile-or" "rest" "patch-i16" "-" "+" 2) :bytecode (16 1 52 0 0 1 33 13 0 20 1 0 16 0 1 2 0 49 2 32 153 0 16 1 52 4 0 1 1 5 0 52 3 0 2 33 20 0 20 6 0 16 0 16 1 52 7 0 1 16 2 16 3 49 4 32 117 0 20 6 0 16 0 16 1 52 7 0 1 16 2 4 48 4 5 20 1 0 16 0 1 8 0 48 2 5 20 1 0 16 0 1 9 0 48 2 5 20 10 0 16 0 48 1 17 4 20 11 0 16 0 1 12 0 48 2 5 20 1 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 1 52 15 0 1 16 2 16 3 48 4 5 20 16 0 16 0 16 4 20 10 0 16 0 48 1 16 4 1 19 0 52 18 0 2 52 17 0 2 49 3 50)} "compile-begin" {:upvalue-count 0 :arity 4 :constants ("not" "empty?" "nil?" "get" "parent" "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "list" ">=" "len" 2 "first" "symbol" "symbol-name" "define" "nth" 1 "scope-define-local") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 58 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 40 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 18 0 5 16 0 52 6 0 1 52 8 0 1 1 9 0 52 0 0 2 33 52 0 16 0 1 11 0 52 10 0 2 17 1 16 1 52 1 0 1 1 7 0 52 0 0 2 33 9 0 16 1 52 8 0 1 32 2 0 16 1 17 2 20 12 0 18 0 16 2 49 2 32 1 0 2 50)} "emit-op" 2 "=" "len" 1 "compile-expr" "first" 5 "compile-begin" "rest") :bytecode (16 1 52 1 0 1 52 0 0 1 6 33 18 0 5 16 2 1 4 0 52 3 0 2 52 2 0 1 52 0 0 1 33 14 0 51 6 0 1 2 16 1 52 5 0 2 32 1 0 2 5 16 1 52 1 0 1 33 13 0 20 7 0 16 0 1 8 0 49 2 32 81 0 16 1 52 10 0 1 1 11 0 52 9 0 2 33 20 0 20 12 0 16 0 16 1 52 13 0 1 16 2 16 3 49 4 32 45 0 20 12 0 16 0 16 1 52 13 0 1 16 2 4 48 4 5 20 7 0 16 0 1 14 0 48 2 5 20 15 0 16 0 16 1 52 16 0 1 16 2 16 3 49 4 50)} "desugar-let-match" {:upvalue-count 0 :arity 1 :constants ("first" "dict?" "nth" 1 "slice" 2 "make-symbol" "__lm_tmp" "list" "append!" "for-each" {:upvalue-count 3 :arity 1 :constants ("append!" "list" "get" "make-symbol" "str") :bytecode (18 0 18 1 16 0 52 2 0 2 1 2 0 52 3 0 1 18 2 16 0 52 4 0 1 52 1 0 3 52 1 0 2 52 0 0 2 50)} "keys" "cons" 3 "=" "str" "_") :bytecode (16 0 52 0 0 1 17 1 16 1 52 1 0 1 33 87 0 16 1 17 2 16 0 1 3 0 52 2 0 2 17 3 16 0 1 5 0 52 4 0 2 17 4 1 7 0 52 6 0 1 17 5 52 8 0 0 17 6 16 6 16 5 16 3 52 8 0 2 52 9 0 2 5 51 11 0 1 6 1 2 1 5 16 2 52 12 0 1 52 10 0 2 5 16 6 16 4 52 13 0 2 32 129 0 16 1 17 2 16 0 1 3 0 52 2 0 2 17 3 16 0 1 5 0 52 2 0 2 17 4 16 0 1 14 0 52 4 0 2 17 5 16 2 52 16 0 1 1 17 0 52 15 0 2 33 10 0 1 7 0 52 6 0 1 32 2 0 16 2 17 6 52 8 0 0 17 7 16 7 16 6 16 3 52 8 0 2 52 9 0 2 5 16 4 52 1 0 1 33 22 0 51 11 0 1 7 1 4 1 6 16 4 52 12 0 1 52 10 0 2 32 1 0 2 5 16 7 16 5 52 13 0 2 50)} "compile-let" {:upvalue-count 0 :arity 4 :constants ("=" "type-of" "first" "symbol" "symbol-name" "nth" 1 "slice" 2 "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("append!" "=" "type-of" "first" "symbol" "make-symbol" "nth" 1) :bytecode (18 0 16 0 52 3 0 1 52 2 0 1 1 4 0 52 1 0 2 33 9 0 16 0 52 3 0 1 32 10 0 16 0 52 3 0 1 52 5 0 1 52 0 0 2 5 18 1 16 0 1 7 0 52 6 0 2 52 0 0 2 50)} "concat" "make-symbol" "fn" "cons" "compile-letrec" "rest" "make-scope" "dict-set!" "next-slot" "get" {:upvalue-count 2 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "nth" 1 "scope-define-local" "compile-expr" "emit-op" 17 "emit-byte") :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 6 0 16 0 52 2 0 1 17 1 16 0 1 6 0 52 5 0 2 17 2 20 7 0 18 0 16 1 48 2 17 3 20 8 0 18 1 16 2 18 0 4 48 4 5 20 9 0 18 1 1 10 0 48 2 5 20 11 0 18 1 16 3 49 2 50)} "compile-begin") :bytecode (16 1 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 135 0 16 1 52 2 0 1 52 4 0 1 17 4 16 1 1 6 0 52 5 0 2 17 5 16 1 1 8 0 52 7 0 2 17 6 52 9 0 0 17 7 52 9 0 0 17 8 51 11 0 1 7 1 8 16 5 52 10 0 2 5 1 14 0 52 13 0 1 16 7 52 9 0 2 16 6 52 12 0 2 17 9 16 4 52 13 0 1 16 9 52 9 0 2 52 9 0 1 17 10 16 4 52 13 0 1 16 8 52 15 0 2 17 11 20 16 0 16 0 16 10 16 11 52 9 0 2 16 2 16 3 49 4 32 71 0 16 1 52 2 0 1 17 4 16 1 52 17 0 1 17 5 20 18 0 16 2 48 1 17 6 16 6 1 20 0 16 2 1 20 0 52 21 0 2 52 19 0 3 5 51 22 0 1 6 1 0 16 4 52 10 0 2 5 20 23 0 16 0 16 5 16 6 16 3 49 4 50)} "compile-letrec" {:upvalue-count 0 :arity 4 :constants ("Compile letrec: all names visible during value compilation.\n 1. Define all local slots (initialized to nil).\n 2. Compile each value and assign — names are already in scope\n so mutually recursive functions can reference each other." "first" "rest" "make-scope" "dict-set!" "next-slot" "get" "map" {:upvalue-count 2 :arity 1 :constants ("=" "type-of" "first" "symbol" "symbol-name" "scope-define-local" "emit-op" 2 17 "emit-byte") :bytecode (16 0 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 0 52 2 0 1 52 4 0 1 32 6 0 16 0 52 2 0 1 17 1 20 5 0 18 0 16 1 48 2 17 2 20 6 0 18 1 1 7 0 48 2 5 20 6 0 18 1 1 8 0 48 2 5 20 9 0 18 1 16 2 48 2 5 16 2 50)} "for-each" {:upvalue-count 2 :arity 1 :constants ("first" "nth" 1 "compile-expr" "emit-op" 17 "emit-byte") :bytecode (16 0 52 0 0 1 17 1 16 0 1 2 0 52 1 0 2 17 2 20 3 0 18 0 16 1 1 2 0 52 1 0 2 18 1 4 48 4 5 20 4 0 18 0 1 5 0 48 2 5 20 6 0 18 0 16 2 49 2 50)} {:upvalue-count 2 :arity 1 :constants ("list" "nth") :bytecode (18 0 16 0 52 1 0 2 18 1 16 0 52 1 0 2 52 0 0 2 50)} "range" 0 "len" "compile-begin") :bytecode (1 0 0 5 16 1 52 1 0 1 17 4 16 1 52 2 0 1 17 5 20 3 0 16 2 48 1 17 6 16 6 1 5 0 16 2 1 5 0 52 6 0 2 52 4 0 3 5 51 8 0 1 6 1 0 16 4 52 7 0 2 17 7 51 10 0 1 0 1 6 51 11 0 1 4 1 7 1 13 0 16 4 52 14 0 1 52 12 0 2 52 7 0 2 52 9 0 2 5 20 15 0 16 0 16 5 16 6 16 3 49 4 50)} "compile-lambda" {:upvalue-count 0 :arity 3 :constants ("first" "rest" "make-scope" "make-emitter" "dict-set!" "is-function" "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "type-of" "symbol" "symbol-name" "list?" "not" "empty?" "first" "&key" "&rest" "scope-define-local") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 9 0 16 0 52 3 0 1 32 61 0 16 0 52 4 0 1 6 33 33 0 5 16 0 52 6 0 1 52 5 0 1 6 33 18 0 5 16 0 52 7 0 1 52 1 0 1 1 2 0 52 0 0 2 33 13 0 16 0 52 7 0 1 52 3 0 1 32 2 0 16 0 17 1 16 1 1 8 0 52 0 0 2 52 5 0 1 6 33 14 0 5 16 1 1 9 0 52 0 0 2 52 5 0 1 33 12 0 20 10 0 18 0 16 1 49 2 32 1 0 2 50)} "compile-begin" "emit-op" 50 "get" "upvalues" "upvalue-count" "len" "arity" "locals" "constants" "pool" "entries" "bytecode" "pool-add" 51 "emit-u16" {:upvalue-count 1 :arity 1 :constants ("emit-byte" "get" "is-local" 1 0 "index") :bytecode (20 0 0 18 0 16 0 1 2 0 52 1 0 2 33 6 0 1 3 0 32 3 0 1 4 0 48 2 5 20 0 0 18 0 16 0 1 5 0 52 1 0 2 49 2 50)}) :bytecode (16 1 52 0 0 1 17 3 16 1 52 1 0 1 17 4 20 2 0 16 2 48 1 17 5 20 3 0 48 0 17 6 16 5 1 5 0 3 52 4 0 3 5 51 7 0 1 5 16 3 52 6 0 2 5 20 8 0 16 6 16 4 16 5 3 48 4 5 20 9 0 16 6 1 10 0 48 2 5 16 5 1 12 0 52 11 0 2 17 7 1 13 0 16 7 52 14 0 1 1 15 0 16 5 1 16 0 52 11 0 2 52 14 0 1 1 17 0 16 6 1 18 0 52 11 0 2 1 19 0 52 11 0 2 1 20 0 16 6 1 20 0 52 11 0 2 65 4 0 17 8 20 21 0 16 0 1 18 0 52 11 0 2 16 8 48 2 17 9 20 9 0 16 0 1 22 0 48 2 5 20 23 0 16 0 16 9 48 2 5 51 24 0 1 0 16 7 52 6 0 2 50)} "compile-define" {:upvalue-count 0 :arity 3 :constants ("first" "=" "type-of" "symbol" "symbol-name" "rest" "not" "empty?" "keyword" {:upvalue-count 1 :arity 1 :constants ("empty?" "=" "type-of" "first" "keyword" "rest") :bytecode (16 0 52 0 0 1 33 4 0 2 32 43 0 16 0 52 3 0 1 52 2 0 1 1 4 0 52 1 0 2 33 17 0 18 0 16 0 52 5 0 1 52 5 0 1 49 1 32 6 0 16 0 52 3 0 1 50)} "nil?" "get" "parent" "scope-define-local" "compile-expr" "emit-op" 17 "emit-byte" "pool-add" "pool" 128 "emit-u16") :bytecode (16 1 52 0 0 1 17 3 16 3 52 2 0 1 1 3 0 52 1 0 2 33 9 0 16 3 52 4 0 1 32 2 0 16 3 17 4 16 1 52 5 0 1 17 6 16 6 52 7 0 1 52 6 0 1 6 33 18 0 5 16 6 52 0 0 1 52 2 0 1 1 8 0 52 1 0 2 33 16 0 51 9 0 1 7 17 7 16 7 16 6 48 1 32 6 0 16 6 52 0 0 1 17 5 16 2 1 12 0 52 11 0 2 52 10 0 1 52 6 0 1 33 47 0 20 13 0 16 2 16 4 48 2 17 6 20 14 0 16 0 16 5 16 2 4 48 4 5 20 15 0 16 0 1 16 0 48 2 5 20 17 0 16 0 16 6 49 2 32 51 0 20 18 0 16 0 1 19 0 52 11 0 2 16 4 48 2 17 6 20 14 0 16 0 16 5 16 2 4 48 4 5 20 15 0 16 0 1 20 0 48 2 5 20 21 0 16 0 16 6 49 2 50)} "compile-set" {:upvalue-count 0 :arity 3 :constants ("=" "type-of" "first" "symbol" "symbol-name" "nth" 1 "scope-resolve" "compile-expr" "get" "type" "local" "emit-op" 17 "emit-byte" "index" "upvalue" 19 "pool-add" "pool" 21 "emit-u16") :bytecode (16 1 52 2 0 1 52 1 0 1 1 3 0 52 0 0 2 33 13 0 16 1 52 2 0 1 52 4 0 1 32 6 0 16 1 52 2 0 1 17 3 16 1 1 6 0 52 5 0 2 17 4 20 7 0 16 2 16 3 48 2 17 5 20 8 0 16 0 16 4 16 2 4 48 4 5 16 5 1 10 0 52 9 0 2 1 11 0 52 0 0 2 33 30 0 20 12 0 16 0 1 13 0 48 2 5 20 14 0 16 0 16 5 1 15 0 52 9 0 2 49 2 32 87 0 16 5 1 10 0 52 9 0 2 1 16 0 52 0 0 2 33 30 0 20 12 0 16 0 1 17 0 48 2 5 20 14 0 16 0 16 5 1 15 0 52 9 0 2 49 2 32 38 0 20 18 0 16 0 1 19 0 52 9 0 2 16 3 48 2 17 6 20 12 0 16 0 1 20 0 48 2 5 20 21 0 16 0 16 6 49 2 50)} "compile-quote" {:upvalue-count 0 :arity 2 :constants ("empty?" "emit-op" 2 "emit-const" "first") :bytecode (16 1 52 0 0 1 33 13 0 20 1 0 16 0 1 2 0 49 2 32 13 0 20 3 0 16 0 16 1 52 4 0 1 49 2 50)} "compile-cond" {:upvalue-count 0 :arity 4 :constants ("Compile (cond test1 body1 test2 body2 ... :else fallback)." "<" "len" 2 "emit-op" "first" "nth" 1 ">" "slice" "list" "=" "type-of" "keyword" "keyword-name" "else" "compile-expr" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+" "compile-cond") :bytecode (1 0 0 5 16 1 52 2 0 1 1 3 0 52 1 0 2 33 13 0 20 4 0 16 0 1 3 0 49 2 32 21 1 16 1 52 5 0 1 17 4 16 1 1 7 0 52 6 0 2 17 5 16 1 52 2 0 1 1 3 0 52 8 0 2 33 12 0 16 1 1 3 0 52 9 0 2 32 4 0 52 10 0 0 17 6 16 4 52 12 0 1 1 13 0 52 11 0 2 6 33 14 0 5 16 4 52 14 0 1 1 15 0 52 11 0 2 6 34 8 0 5 16 4 3 52 11 0 2 33 16 0 20 16 0 16 0 16 5 16 2 16 3 49 4 32 162 0 20 16 0 16 0 16 4 16 2 4 48 4 5 20 4 0 16 0 1 17 0 48 2 5 20 18 0 16 0 48 1 17 7 20 19 0 16 0 1 20 0 48 2 5 20 16 0 16 0 16 5 16 2 16 3 48 4 5 20 4 0 16 0 1 21 0 48 2 5 20 18 0 16 0 48 1 17 8 20 19 0 16 0 1 20 0 48 2 5 20 22 0 16 0 16 7 20 18 0 16 0 48 1 16 7 1 3 0 52 24 0 2 52 23 0 2 48 3 5 20 25 0 16 0 16 6 16 2 16 3 48 4 5 20 22 0 16 0 16 8 20 18 0 16 0 48 1 16 8 1 3 0 52 24 0 2 52 23 0 2 49 3 50)} "compile-case" {:upvalue-count 0 :arity 4 :constants ("Compile (case expr val1 body1 val2 body2 ... :else fallback)." "compile-expr" "first" "rest" "compile-case-clauses") :bytecode (1 0 0 5 20 1 0 16 0 16 1 52 2 0 1 16 2 4 48 4 5 16 1 52 3 0 1 17 4 20 4 0 16 0 16 4 16 2 16 3 49 4 50)} "compile-case-clauses" {:upvalue-count 0 :arity 4 :constants ("<" "len" 2 "emit-op" 5 "first" "nth" 1 ">" "slice" "list" "=" "type-of" "keyword" "keyword-name" "else" "compile-expr" 6 "pool-add" "get" "pool" 52 "emit-u16" "emit-byte" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+" "compile-case-clauses") :bytecode (16 1 52 1 0 1 1 2 0 52 0 0 2 33 24 0 20 3 0 16 0 1 4 0 48 2 5 20 3 0 16 0 1 2 0 49 2 32 105 1 16 1 52 5 0 1 17 4 16 1 1 7 0 52 6 0 2 17 5 16 1 52 1 0 1 1 2 0 52 8 0 2 33 12 0 16 1 1 2 0 52 9 0 2 32 4 0 52 10 0 0 17 6 16 4 52 12 0 1 1 13 0 52 11 0 2 6 33 14 0 5 16 4 52 14 0 1 1 15 0 52 11 0 2 6 34 8 0 5 16 4 3 52 11 0 2 33 27 0 20 3 0 16 0 1 4 0 48 2 5 20 16 0 16 0 16 5 16 2 16 3 49 4 32 235 0 20 3 0 16 0 1 17 0 48 2 5 20 16 0 16 0 16 4 16 2 4 48 4 5 20 18 0 16 0 1 20 0 52 19 0 2 1 11 0 48 2 17 7 20 3 0 16 0 1 21 0 48 2 5 20 22 0 16 0 16 7 48 2 5 20 23 0 16 0 1 2 0 48 2 5 20 3 0 16 0 1 24 0 48 2 5 20 25 0 16 0 48 1 17 7 20 26 0 16 0 1 27 0 48 2 5 20 3 0 16 0 1 4 0 48 2 5 20 16 0 16 0 16 5 16 2 16 3 48 4 5 20 3 0 16 0 1 28 0 48 2 5 20 25 0 16 0 48 1 17 8 20 26 0 16 0 1 27 0 48 2 5 20 29 0 16 0 16 7 20 25 0 16 0 48 1 16 7 1 2 0 52 31 0 2 52 30 0 2 48 3 5 20 32 0 16 0 16 6 16 2 16 3 48 4 5 20 29 0 16 0 16 8 20 25 0 16 0 48 1 16 8 1 2 0 52 31 0 2 52 30 0 2 49 3 50)} "compile-match" {:upvalue-count 0 :arity 4 :constants ("compile-expr" "first" {:upvalue-count 4 :arity 1 :constants ("empty?" "emit-op" 5 "pool-add" "get" "pool" "match: no clause matched" 1 "emit-u16" 52 "error" "emit-byte" "first" "nth" "rest" "=" "type-of" "symbol" "symbol-name" "_" "compile-expr" "not" "true" "false" "nil" "scope-add" 13 "scope-index" "list?" "len" 2 "quote" 6 "make-symbol" 33 "current-offset" "emit-i16" 0 32 "patch-i16" "-" "+") :bytecode (16 0 52 0 0 1 33 100 0 20 1 0 18 0 1 2 0 48 2 5 20 3 0 18 0 1 5 0 52 4 0 2 1 6 0 48 2 17 1 20 1 0 18 0 1 7 0 48 2 5 20 8 0 18 0 16 1 48 2 5 20 1 0 18 0 1 9 0 48 2 5 20 8 0 18 0 20 3 0 18 0 1 5 0 52 4 0 2 1 10 0 48 2 48 2 5 20 11 0 18 0 1 7 0 49 2 32 69 3 16 0 52 12 0 1 17 1 16 1 52 12 0 1 17 2 16 1 1 7 0 52 13 0 2 17 3 16 0 52 14 0 1 17 4 16 2 52 16 0 1 1 17 0 52 15 0 2 6 33 14 0 5 16 2 52 18 0 1 1 19 0 52 15 0 2 33 27 0 20 1 0 18 0 1 2 0 48 2 5 20 20 0 18 0 16 3 18 1 18 2 49 4 32 229 2 16 2 52 16 0 1 1 17 0 52 15 0 2 6 33 62 0 5 16 2 52 18 0 1 1 22 0 52 15 0 2 52 21 0 1 6 33 40 0 5 16 2 52 18 0 1 1 23 0 52 15 0 2 52 21 0 1 6 33 18 0 5 16 2 52 18 0 1 1 24 0 52 15 0 2 52 21 0 1 33 63 0 16 2 52 18 0 1 17 5 20 25 0 18 1 16 5 48 2 17 6 20 1 0 18 0 1 26 0 48 2 5 20 11 0 18 0 20 27 0 16 6 16 5 48 2 48 2 5 20 20 0 18 0 16 3 16 6 18 2 49 4 32 84 2 16 2 52 28 0 1 6 33 83 0 5 16 2 52 29 0 1 1 30 0 52 15 0 2 6 33 65 0 5 16 2 52 12 0 1 52 16 0 1 1 17 0 52 15 0 2 6 33 43 0 5 16 2 52 12 0 1 52 18 0 1 1 31 0 52 15 0 2 6 33 21 0 5 16 2 1 7 0 52 13 0 2 52 16 0 1 1 17 0 52 15 0 2 33 16 1 20 1 0 18 0 1 32 0 48 2 5 20 3 0 18 0 1 5 0 52 4 0 2 16 2 1 7 0 52 13 0 2 52 18 0 1 52 33 0 1 48 2 17 5 20 1 0 18 0 1 7 0 48 2 5 20 8 0 18 0 16 5 48 2 5 20 3 0 18 0 1 5 0 52 4 0 2 1 15 0 48 2 17 5 20 1 0 18 0 1 9 0 48 2 5 20 8 0 18 0 16 5 48 2 5 20 11 0 18 0 1 30 0 48 2 5 20 1 0 18 0 1 34 0 48 2 5 20 35 0 18 0 48 1 17 5 20 36 0 18 0 1 37 0 48 2 5 20 1 0 18 0 1 2 0 48 2 5 20 20 0 18 0 16 3 18 1 18 2 48 4 5 20 1 0 18 0 1 38 0 48 2 5 20 35 0 18 0 48 1 17 6 20 36 0 18 0 1 37 0 48 2 5 20 39 0 18 0 16 5 20 35 0 18 0 48 1 16 5 1 30 0 52 41 0 2 52 40 0 2 48 3 5 18 3 16 4 48 1 5 20 39 0 18 0 16 6 20 35 0 18 0 48 1 16 6 1 30 0 52 41 0 2 52 40 0 2 49 3 32 228 0 20 1 0 18 0 1 32 0 48 2 5 20 20 0 18 0 16 2 18 1 4 48 4 5 20 3 0 18 0 1 5 0 52 4 0 2 1 15 0 48 2 17 5 20 1 0 18 0 1 9 0 48 2 5 20 8 0 18 0 16 5 48 2 5 20 11 0 18 0 1 30 0 48 2 5 20 1 0 18 0 1 34 0 48 2 5 20 35 0 18 0 48 1 17 5 20 36 0 18 0 1 37 0 48 2 5 20 1 0 18 0 1 2 0 48 2 5 20 20 0 18 0 16 3 18 1 18 2 48 4 5 20 1 0 18 0 1 38 0 48 2 5 20 35 0 18 0 48 1 17 6 20 36 0 18 0 1 37 0 48 2 5 20 39 0 18 0 16 5 20 35 0 18 0 48 1 16 5 1 30 0 52 41 0 2 52 40 0 2 48 3 5 18 3 16 4 48 1 5 20 39 0 18 0 16 6 20 35 0 18 0 48 1 16 6 1 30 0 52 41 0 2 52 40 0 2 49 3 50)} "rest") :bytecode (20 0 0 16 0 16 1 52 1 0 1 16 2 4 48 4 5 2 17 4 51 2 0 1 0 1 2 1 3 1 4 17 4 16 4 16 1 52 3 0 1 49 1 50)} "compile-thread" {:upvalue-count 0 :arity 4 :constants ("Compile (-> val (f1 a) (f2 b)) by desugaring to nested calls." "empty?" "emit-op" 2 "=" "len" 1 "compile-expr" "first" "rest" "compile-thread-step") :bytecode (1 0 0 5 16 1 52 1 0 1 33 13 0 20 2 0 16 0 1 3 0 49 2 32 67 0 16 1 52 5 0 1 1 6 0 52 4 0 2 33 20 0 20 7 0 16 0 16 1 52 8 0 1 16 2 16 3 49 4 32 31 0 16 1 52 8 0 1 17 4 16 1 52 9 0 1 17 5 20 10 0 16 0 16 4 16 5 16 2 16 3 49 5 50)} "compile-thread-step" {:upvalue-count 0 :arity 5 :constants ("empty?" "compile-expr" "first" "rest" "list?" "concat" "list" "compile-thread-step") :bytecode (16 2 52 0 0 1 33 16 0 20 1 0 16 0 16 1 16 3 16 4 49 4 32 128 0 16 2 52 2 0 1 17 5 16 2 52 3 0 1 17 6 16 4 6 33 7 0 5 16 6 52 0 0 1 17 7 16 5 52 4 0 1 33 25 0 16 5 52 2 0 1 16 1 52 6 0 2 16 5 52 3 0 1 52 5 0 2 32 8 0 16 5 16 1 52 6 0 2 17 8 16 6 52 0 0 1 33 16 0 20 1 0 16 0 16 8 16 3 16 7 49 4 32 28 0 20 1 0 16 0 16 8 16 3 4 48 4 5 20 7 0 16 0 16 8 16 6 16 3 16 4 49 5 50)} "compile-defcomp" {:upvalue-count 0 :arity 3 :constants ("Compile defcomp/defisland — delegates to runtime via GLOBAL_GET + CALL." "pool-add" "get" "pool" "eval-defcomp" "emit-op" 20 "emit-u16" "emit-const" "concat" "list" "make-symbol" "defcomp" 48 "emit-byte" 1) :bytecode (1 0 0 5 20 1 0 16 0 1 3 0 52 2 0 2 1 4 0 48 2 17 3 20 5 0 16 0 1 6 0 48 2 5 20 7 0 16 0 16 3 48 2 5 20 8 0 16 0 1 12 0 52 11 0 1 52 10 0 1 16 1 52 9 0 2 48 2 5 20 5 0 16 0 1 13 0 48 2 5 20 14 0 16 0 1 15 0 49 2 50)} "compile-defmacro" {:upvalue-count 0 :arity 3 :constants ("Compile defmacro — delegates to runtime via GLOBAL_GET + CALL." "pool-add" "get" "pool" "eval-defmacro" "emit-op" 20 "emit-u16" "emit-const" "concat" "list" "make-symbol" "defmacro" 48 "emit-byte" 1) :bytecode (1 0 0 5 20 1 0 16 0 1 3 0 52 2 0 2 1 4 0 48 2 17 3 20 5 0 16 0 1 6 0 48 2 5 20 7 0 16 0 16 3 48 2 5 20 8 0 16 0 1 12 0 52 11 0 1 52 10 0 1 16 1 52 9 0 2 48 2 5 20 5 0 16 0 1 13 0 48 2 5 20 14 0 16 0 1 15 0 49 2 50)} "compile-quasiquote" {:upvalue-count 0 :arity 3 :constants ("Compile quasiquote inline — walks the template at compile time,\n emitting code that builds the structure at runtime. Unquoted\n expressions are compiled normally (resolving locals/upvalues),\n avoiding the qq-expand-runtime env-lookup limitation." "compile-qq-expr") :bytecode (1 0 0 5 20 1 0 16 0 16 1 16 2 49 3 50)} "compile-qq-expr" {:upvalue-count 0 :arity 3 :constants ("Compile a quasiquote sub-expression." "not" "=" "type-of" "list" "emit-const" "empty?" "emit-op" 64 "emit-u16" 0 "first" "symbol" "symbol-name" "unquote" "compile-expr" "nth" 1 "compile-qq-list") :bytecode (1 0 0 5 16 1 52 3 0 1 1 4 0 52 2 0 2 52 1 0 1 33 12 0 20 5 0 16 0 16 1 49 2 32 108 0 16 1 52 6 0 1 33 24 0 20 7 0 16 0 1 8 0 48 2 5 20 9 0 16 0 1 10 0 49 2 32 75 0 16 1 52 11 0 1 17 3 16 3 52 3 0 1 1 12 0 52 2 0 2 6 33 14 0 5 16 3 52 13 0 1 1 14 0 52 2 0 2 33 22 0 20 15 0 16 0 16 1 1 17 0 52 16 0 2 16 2 4 49 4 32 11 0 20 18 0 16 0 16 1 16 2 49 3 50)} "compile-qq-list" {:upvalue-count 0 :arity 3 :constants ("Compile a quasiquote list. Handles splice-unquote by building\n segments and concatenating them." "some" {:upvalue-count 0 :arity 1 :constants ("=" "type-of" "list" ">=" "len" 2 "first" "symbol" "symbol-name" "splice-unquote") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 58 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 40 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 18 0 5 16 0 52 6 0 1 52 8 0 1 1 9 0 52 0 0 2 50)} "not" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-qq-expr") :bytecode (20 0 0 18 0 16 0 18 1 49 3 50)} "emit-op" 64 "emit-u16" "len" 0 {:upvalue-count 4 :arity 1 :constants ("=" "type-of" "list" ">=" "len" 2 "first" "symbol" "symbol-name" "splice-unquote" ">" 0 "emit-op" 64 "emit-u16" "+" 1 "compile-expr" "nth" "compile-qq-expr") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 6 33 58 0 5 16 0 52 4 0 1 1 5 0 52 3 0 2 6 33 40 0 5 16 0 52 6 0 1 52 1 0 1 1 7 0 52 0 0 2 6 33 18 0 5 16 0 52 6 0 1 52 8 0 1 1 9 0 52 0 0 2 33 89 0 18 0 1 11 0 52 10 0 2 33 41 0 20 12 0 18 1 1 13 0 48 2 5 20 14 0 18 1 18 0 48 2 5 18 2 1 16 0 52 15 0 2 19 2 5 1 11 0 19 0 32 1 0 2 5 20 17 0 18 1 16 0 1 16 0 52 18 0 2 18 3 4 48 4 5 18 2 1 16 0 52 15 0 2 19 2 32 23 0 20 19 0 18 1 16 0 18 3 48 3 5 18 0 1 16 0 52 15 0 2 19 0 50)} ">" "+" 1 "pool-add" "get" "pool" "concat" 52 "emit-byte") :bytecode (1 0 0 5 51 2 0 16 1 52 1 0 2 17 3 16 3 52 3 0 1 33 41 0 51 5 0 1 0 1 2 16 1 52 4 0 2 5 20 6 0 16 0 1 7 0 48 2 5 20 8 0 16 0 16 1 52 9 0 1 49 2 32 142 0 1 10 0 17 4 1 10 0 17 5 51 11 0 1 5 1 0 1 4 1 2 16 1 52 4 0 2 5 16 5 1 10 0 52 12 0 2 33 35 0 20 6 0 16 0 1 7 0 48 2 5 20 8 0 16 0 16 5 48 2 5 16 4 1 14 0 52 13 0 2 17 4 32 1 0 2 5 16 4 1 14 0 52 12 0 2 33 52 0 20 15 0 16 0 1 17 0 52 16 0 2 1 18 0 48 2 17 6 20 6 0 16 0 1 19 0 48 2 5 20 8 0 16 0 16 6 48 2 5 20 20 0 16 0 16 4 49 2 32 1 0 2 50)} "compile-call" {:upvalue-count 0 :arity 5 :constants ("=" "type-of" "symbol" "symbol-name" "not" "get" "scope-resolve" "type" "local" "upvalue" "primitive?" "len" "pool-add" "pool" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-expr") :bytecode (20 0 0 18 0 16 0 18 1 4 49 4 50)} "emit-op" 52 "emit-u16" "emit-byte" "compile-expr" 49 48) :bytecode (16 1 52 1 0 1 1 2 0 52 0 0 2 6 33 79 0 5 16 1 52 3 0 1 17 6 20 6 0 16 3 16 6 48 2 1 7 0 52 5 0 2 1 8 0 52 0 0 2 52 4 0 1 6 33 39 0 5 20 6 0 16 3 16 6 48 2 1 7 0 52 5 0 2 1 9 0 52 0 0 2 52 4 0 1 6 33 7 0 5 16 6 52 10 0 1 17 5 16 5 33 81 0 16 1 52 3 0 1 17 6 16 2 52 11 0 1 17 7 20 12 0 16 0 1 13 0 52 5 0 2 16 6 48 2 17 8 51 15 0 1 0 1 3 16 2 52 14 0 2 5 20 16 0 16 0 1 17 0 48 2 5 20 18 0 16 0 16 8 48 2 5 20 19 0 16 0 16 7 49 2 32 83 0 20 20 0 16 0 16 1 16 3 4 48 4 5 51 15 0 1 0 1 3 16 2 52 14 0 2 5 16 4 33 27 0 20 16 0 16 0 1 21 0 48 2 5 20 19 0 16 0 16 2 52 11 0 1 49 2 32 24 0 20 16 0 16 0 1 22 0 48 2 5 20 19 0 16 0 16 2 52 11 0 1 49 2 50)} "compile" {:upvalue-count 0 :arity 1 :constants ("Compile a single SX expression to a bytecode module." "make-emitter" "make-scope" "compile-expr" "emit-op" 50 "constants" "get" "pool" "entries" "bytecode") :bytecode (1 0 0 5 20 1 0 48 0 17 1 20 2 0 2 48 1 17 2 20 3 0 16 1 16 0 16 2 4 48 4 5 20 4 0 16 1 1 5 0 48 2 5 1 6 0 16 1 1 8 0 52 7 0 2 1 9 0 52 7 0 2 1 10 0 16 1 1 10 0 52 7 0 2 65 2 0 50)} "compile-module" {:upvalue-count 0 :arity 1 :constants ("Compile a list of top-level expressions to a bytecode module." "make-emitter" "make-scope" "for-each" {:upvalue-count 2 :arity 1 :constants ("compile-expr" "emit-op" 5) :bytecode (20 0 0 18 0 16 0 18 1 4 48 4 5 20 1 0 18 0 1 2 0 49 2 50)} "init" "compile-expr" "last" "emit-op" 50 "constants" "get" "pool" "entries" "bytecode") :bytecode (1 0 0 5 20 1 0 48 0 17 1 20 2 0 2 48 1 17 2 51 4 0 1 1 1 2 16 0 52 5 0 1 52 3 0 2 5 20 6 0 16 1 16 0 52 7 0 1 16 2 4 48 4 5 20 8 0 16 1 1 9 0 48 2 5 1 10 0 16 1 1 12 0 52 11 0 2 1 13 0 52 11 0 2 1 14 0 16 1 1 14 0 52 11 0 2 65 2 0 50)} {:library (sx compiler) :op "import"}) :bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 41 0 128 40 0 5 51 43 0 128 42 0 5 51 45 0 128 44 0 5 51 47 0 128 46 0 5 51 49 0 128 48 0 5 51 51 0 128 50 0 5 51 53 0 128 52 0 5 51 55 0 128 54 0 5 51 57 0 128 56 0 5 51 59 0 128 58 0 5 51 61 0 128 60 0 5 51 63 0 128 62 0 5 51 65 0 128 64 0 5 51 67 0 128 66 0 5 51 69 0 128 68 0 5 51 71 0 128 70 0 5 51 73 0 128 72 0 5 51 75 0 128 74 0 5 51 77 0 128 76 0 5 51 79 0 128 78 0 5 51 81 0 128 80 0 5 51 83 0 128 82 0 5 51 85 0 128 84 0 5 1 86 0 112 50))) diff --git a/shared/static/wasm/sx/deps.sx b/shared/static/wasm/sx/deps.sx index fca9ff79..ad15e720 100644 --- a/shared/static/wasm/sx/deps.sx +++ b/shared/static/wasm/sx/deps.sx @@ -1,6 +1,7 @@ -(define-library (web deps) +(define-library + (web deps) (export scan-refs scan-refs-walk @@ -22,347 +23,351 @@ page-render-plan env-components) (begin - -(define - scan-refs - :effects () - (fn (node) (let ((refs (list))) (scan-refs-walk node refs) refs))) - -(define - scan-refs-walk - :effects () - (fn - (node (refs :as list)) - (cond - (= (type-of node) "symbol") - (let - ((name (symbol-name node))) - (when - (starts-with? name "~") - (when (not (contains? refs name)) (append! refs name)))) - (= (type-of node) "list") - (for-each (fn (item) (scan-refs-walk item refs)) node) - (= (type-of node) "dict") - (for-each - (fn (key) (scan-refs-walk (dict-get node key) refs)) - (keys node)) - :else nil))) - -(define - transitive-deps-walk - :effects () - (fn - ((n :as string) (seen :as list) (env :as dict)) - (when - (not (contains? seen n)) - (append! seen n) - (let - ((val (env-get env n))) - (cond - (or (= (type-of val) "component") (= (type-of val) "island")) - (for-each - (fn ((ref :as string)) (transitive-deps-walk ref seen env)) - (scan-refs (component-body val))) - (= (type-of val) "macro") - (for-each - (fn ((ref :as string)) (transitive-deps-walk ref seen env)) - (scan-refs (macro-body val))) - :else nil))))) - -(define - transitive-deps - :effects () - (fn - ((name :as string) (env :as dict)) - (let - ((seen (list)) - (key (if (starts-with? name "~") name (str "~" name)))) - (transitive-deps-walk key seen env) - (filter (fn ((x :as string)) (not (= x key))) seen)))) - -(define - compute-all-deps - :effects (mutation) - (fn - ((env :as dict)) - (for-each + (define + scan-refs + :effects () + (fn (node) (let ((refs (list))) (scan-refs-walk node refs) refs))) + (define + scan-refs-walk + :effects () (fn - ((name :as string)) - (let - ((val (env-get env name))) - (when - (or (= (type-of val) "component") (= (type-of val) "island")) - (component-set-deps! val (transitive-deps name env))))) - (env-components env)))) - -(define - scan-components-from-source - :effects () - (fn - ((source :as string)) - (let - ((matches (regex-find-all "\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)" source))) - (map (fn ((m :as string)) (str "~" m)) matches)))) - -(define - components-needed - :effects () - (fn - ((page-source :as string) (env :as dict)) - (let - ((direct (scan-components-from-source page-source)) - (all-needed (list))) - (for-each - (fn - ((name :as string)) - (when (not (contains? all-needed name)) (append! all-needed name)) - (let - ((val (env-get env name))) + (node (refs :as list)) + (match + (type-of node) + ("symbol" (let - ((deps (if (and (= (type-of val) "component") (not (empty? (component-deps val)))) (component-deps val) (transitive-deps name env)))) - (for-each - (fn - ((dep :as string)) - (when - (not (contains? all-needed dep)) - (append! all-needed dep))) - deps)))) - direct) - all-needed))) - -(define - page-component-bundle - :effects () - (fn - ((page-source :as string) (env :as dict)) - (components-needed page-source env))) - -(define - page-css-classes - :effects () - (fn - ((page-source :as string) (env :as dict)) - (let - ((needed (components-needed page-source env)) (classes (list))) - (for-each - (fn - ((name :as string)) - (let - ((val (env-get env name))) - (when - (= (type-of val) "component") - (for-each - (fn - ((cls :as string)) - (when (not (contains? classes cls)) (append! classes cls))) - (component-css-classes val))))) - needed) - (for-each - (fn - ((cls :as string)) - (when (not (contains? classes cls)) (append! classes cls))) - (scan-css-classes page-source)) - classes))) - -(define - scan-io-refs-walk - :effects () - (fn - (node (io-names :as list) (refs :as list)) - (cond - (= (type-of node) "symbol") - (let - ((name (symbol-name node))) - (when - (contains? io-names name) - (when (not (contains? refs name)) (append! refs name)))) - (= (type-of node) "list") - (for-each (fn (item) (scan-io-refs-walk item io-names refs)) node) - (= (type-of node) "dict") - (for-each - (fn (key) (scan-io-refs-walk (dict-get node key) io-names refs)) - (keys node)) - :else nil))) - -(define - scan-io-refs - :effects () - (fn - (node (io-names :as list)) - (let ((refs (list))) (scan-io-refs-walk node io-names refs) refs))) - -(define - transitive-io-refs-walk - :effects () - (fn - ((n :as string) - (seen :as list) - (all-refs :as list) - (env :as dict) - (io-names :as list)) - (when - (not (contains? seen n)) - (append! seen n) - (let - ((val (env-get env n))) - (cond - (= (type-of val) "component") - (do + ((name (symbol-name node))) + (when + (starts-with? name "~") + (when (not (contains? refs name)) (append! refs name))))) + ("list" (for-each (fn (item) (scan-refs-walk item refs)) node)) + ("dict" (for-each - (fn - ((ref :as string)) - (when (not (contains? all-refs ref)) (append! all-refs ref))) - (scan-io-refs (component-body val) io-names)) - (for-each - (fn - ((dep :as string)) - (transitive-io-refs-walk dep seen all-refs env io-names)) - (scan-refs (component-body val)))) - (= (type-of val) "macro") - (do - (for-each - (fn - ((ref :as string)) - (when (not (contains? all-refs ref)) (append! all-refs ref))) - (scan-io-refs (macro-body val) io-names)) - (for-each - (fn - ((dep :as string)) - (transitive-io-refs-walk dep seen all-refs env io-names)) - (scan-refs (macro-body val)))) - :else nil))))) - -(define - transitive-io-refs - :effects () - (fn - ((name :as string) (env :as dict) (io-names :as list)) - (let - ((all-refs (list)) - (seen (list)) - (key (if (starts-with? name "~") name (str "~" name)))) - (transitive-io-refs-walk key seen all-refs env io-names) - all-refs))) - -(define - compute-all-io-refs - :effects (mutation) - (fn - ((env :as dict) (io-names :as list)) - (for-each + (fn (key) (scan-refs-walk (dict-get node key) refs)) + (keys node))) + (_ nil)))) + (define + transitive-deps-walk + :effects () (fn - ((name :as string)) - (let - ((val (env-get env name))) - (when - (= (type-of val) "component") - (component-set-io-refs! - val - (transitive-io-refs name env io-names))))) - (env-components env)))) - -(define - component-io-refs-cached - :effects () - (fn - ((name :as string) (env :as dict) (io-names :as list)) - (let - ((key (if (starts-with? name "~") name (str "~" name)))) - (let - ((val (env-get env key))) - (if - (and - (= (type-of val) "component") - (not (nil? (component-io-refs val))) - (not (empty? (component-io-refs val)))) - (component-io-refs val) - (transitive-io-refs name env io-names)))))) - -(define - component-pure? - :effects () - (fn - (name (env :as dict) (io-names :as list)) - (let - ((key (if (starts-with? name "~") name (str "~" name)))) - (let - ((val (if (env-has? env key) (env-get env key) nil))) - (if - (and - (= (type-of val) "component") - (not (nil? (component-io-refs val))) - (not (empty? (component-io-refs val)))) - false - (empty? (transitive-io-refs name env io-names))))))) - -(define - render-target - :effects () - (fn - (name (env :as dict) (io-names :as list)) - (let - ((key (if (starts-with? name "~") name (str "~" name)))) - (let - ((val (if (env-has? env key) (env-get env key) nil))) - (if - (not (= (type-of val) "component")) - "server" + ((n :as string) (seen :as list) (env :as dict)) + (when + (not (contains? seen n)) + (append! seen n) (let - ((affinity (component-affinity val))) - (cond - (= affinity "server") - "server" - (= affinity "client") - "client" - (not (component-pure? name env io-names)) - "server" - :else "client"))))))) - -(define - page-render-plan - :effects () - (fn - ((page-source :as string) (env :as dict) (io-names :as list)) - (let - ((needed (components-needed page-source env)) - (comp-targets (dict)) - (server-list (list)) - (client-list (list)) - (io-deps (list))) - (for-each - (fn - ((name :as string)) - (let - ((target (render-target name env io-names))) - (dict-set! comp-targets name target) - (if - (= target "server") - (do - (append! server-list name) + ((val (env-get env n))) + (match + (type-of val) + ("component" (for-each (fn - ((io-ref :as string)) - (when - (not (contains? io-deps io-ref)) - (append! io-deps io-ref))) - (component-io-refs-cached name env io-names))) - (append! client-list name)))) - needed) - {:io-deps io-deps :server server-list :components comp-targets :client client-list}))) - -(define - env-components - :effects () - (fn - ((env :as dict)) - (filter + ((ref :as string)) + (transitive-deps-walk ref seen env)) + (scan-refs (component-body val)))) + ("island" + (for-each + (fn + ((ref :as string)) + (transitive-deps-walk ref seen env)) + (scan-refs (component-body val)))) + ("macro" + (for-each + (fn + ((ref :as string)) + (transitive-deps-walk ref seen env)) + (scan-refs (macro-body val)))) + (_ nil)))))) + (define + transitive-deps + :effects () (fn - ((k :as string)) - (let ((v (env-get env k))) (or (component? v) (macro? v)))) - (keys env)))) - - -)) ;; end define-library + ((name :as string) (env :as dict)) + (let + ((seen (list)) + (key (if (starts-with? name "~") name (str "~" name)))) + (transitive-deps-walk key seen env) + (filter (fn ((x :as string)) (not (= x key))) seen)))) + (define + compute-all-deps + :effects (mutation) + (fn + ((env :as dict)) + (for-each + (fn + ((name :as string)) + (let + ((val (env-get env name))) + (when + (or + (= (type-of val) "component") + (= (type-of val) "island")) + (component-set-deps! val (transitive-deps name env))))) + (env-components env)))) + (define + scan-components-from-source + :effects () + (fn + ((source :as string)) + (let + ((matches (regex-find-all "\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)" source))) + (map (fn ((m :as string)) (str "~" m)) matches)))) + (define + components-needed + :effects () + (fn + ((page-source :as string) (env :as dict)) + (let + ((direct (scan-components-from-source page-source)) + (all-needed (list))) + (for-each + (fn + ((name :as string)) + (when + (not (contains? all-needed name)) + (append! all-needed name)) + (let + ((val (env-get env name))) + (let + ((deps (if (and (= (type-of val) "component") (not (empty? (component-deps val)))) (component-deps val) (transitive-deps name env)))) + (for-each + (fn + ((dep :as string)) + (when + (not (contains? all-needed dep)) + (append! all-needed dep))) + deps)))) + direct) + all-needed))) + (define + page-component-bundle + :effects () + (fn + ((page-source :as string) (env :as dict)) + (components-needed page-source env))) + (define + page-css-classes + :effects () + (fn + ((page-source :as string) (env :as dict)) + (let + ((needed (components-needed page-source env)) (classes (list))) + (for-each + (fn + ((name :as string)) + (let + ((val (env-get env name))) + (when + (= (type-of val) "component") + (for-each + (fn + ((cls :as string)) + (when + (not (contains? classes cls)) + (append! classes cls))) + (component-css-classes val))))) + needed) + (for-each + (fn + ((cls :as string)) + (when (not (contains? classes cls)) (append! classes cls))) + (scan-css-classes page-source)) + classes))) + (define + scan-io-refs-walk + :effects () + (fn + (node (io-names :as list) (refs :as list)) + (match + (type-of node) + ("symbol" + (let + ((name (symbol-name node))) + (when + (contains? io-names name) + (when (not (contains? refs name)) (append! refs name))))) + ("list" + (for-each + (fn (item) (scan-io-refs-walk item io-names refs)) + node)) + ("dict" + (for-each + (fn + (key) + (scan-io-refs-walk (dict-get node key) io-names refs)) + (keys node))) + (_ nil)))) + (define + scan-io-refs + :effects () + (fn + (node (io-names :as list)) + (let ((refs (list))) (scan-io-refs-walk node io-names refs) refs))) + (define + transitive-io-refs-walk + :effects () + (fn + ((n :as string) + (seen :as list) + (all-refs :as list) + (env :as dict) + (io-names :as list)) + (when + (not (contains? seen n)) + (append! seen n) + (let + ((val (env-get env n))) + (match + (type-of val) + ("component" + (do + (for-each + (fn + ((ref :as string)) + (when + (not (contains? all-refs ref)) + (append! all-refs ref))) + (scan-io-refs (component-body val) io-names)) + (for-each + (fn + ((dep :as string)) + (transitive-io-refs-walk dep seen all-refs env io-names)) + (scan-refs (component-body val))))) + ("macro" + (do + (for-each + (fn + ((ref :as string)) + (when + (not (contains? all-refs ref)) + (append! all-refs ref))) + (scan-io-refs (macro-body val) io-names)) + (for-each + (fn + ((dep :as string)) + (transitive-io-refs-walk dep seen all-refs env io-names)) + (scan-refs (macro-body val))))) + (_ nil)))))) + (define + transitive-io-refs + :effects () + (fn + ((name :as string) (env :as dict) (io-names :as list)) + (let + ((all-refs (list)) + (seen (list)) + (key (if (starts-with? name "~") name (str "~" name)))) + (transitive-io-refs-walk key seen all-refs env io-names) + all-refs))) + (define + compute-all-io-refs + :effects (mutation) + (fn + ((env :as dict) (io-names :as list)) + (for-each + (fn + ((name :as string)) + (let + ((val (env-get env name))) + (when + (= (type-of val) "component") + (component-set-io-refs! + val + (transitive-io-refs name env io-names))))) + (env-components env)))) + (define + component-io-refs-cached + :effects () + (fn + ((name :as string) (env :as dict) (io-names :as list)) + (let + ((key (if (starts-with? name "~") name (str "~" name)))) + (let + ((val (env-get env key))) + (if + (and + (= (type-of val) "component") + (not (nil? (component-io-refs val))) + (not (empty? (component-io-refs val)))) + (component-io-refs val) + (transitive-io-refs name env io-names)))))) + (define + component-pure? + :effects () + (fn + (name (env :as dict) (io-names :as list)) + (let + ((key (if (starts-with? name "~") name (str "~" name)))) + (let + ((val (if (env-has? env key) (env-get env key) nil))) + (if + (and + (= (type-of val) "component") + (not (nil? (component-io-refs val))) + (not (empty? (component-io-refs val)))) + false + (empty? (transitive-io-refs name env io-names))))))) + (define + render-target + :effects () + (fn + (name (env :as dict) (io-names :as list)) + (let + ((key (if (starts-with? name "~") name (str "~" name)))) + (let + ((val (if (env-has? env key) (env-get env key) nil))) + (if + (not (= (type-of val) "component")) + "server" + (match + (component-affinity val) + ("server" "server") + ("client" "client") + (_ + (if + (not (component-pure? name env io-names)) + "server" + "client")))))))) + (define + page-render-plan + :effects () + (fn + ((page-source :as string) (env :as dict) (io-names :as list)) + (let + ((needed (components-needed page-source env)) + (comp-targets (dict)) + (server-list (list)) + (client-list (list)) + (io-deps (list))) + (for-each + (fn + ((name :as string)) + (let + ((target (render-target name env io-names))) + (dict-set! comp-targets name target) + (if + (= target "server") + (do + (append! server-list name) + (for-each + (fn + ((io-ref :as string)) + (when + (not (contains? io-deps io-ref)) + (append! io-deps io-ref))) + (component-io-refs-cached name env io-names))) + (append! client-list name)))) + needed) + {:io-deps io-deps :server server-list :components comp-targets :client client-list}))) + (define + env-components + :effects () + (fn + ((env :as dict)) + (filter + (fn + ((k :as string)) + (let ((v (env-get env k))) (or (component? v) (macro? v)))) + (keys env)))))) ;; end define-library ;; Re-export to global namespace for backward compatibility (import (web deps)) diff --git a/shared/static/wasm/sx/deps.sxbc b/shared/static/wasm/sx/deps.sxbc index ae82bbbb..49be6526 100644 --- a/shared/static/wasm/sx/deps.sxbc +++ b/shared/static/wasm/sx/deps.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "710e328bd077e96c" +(sxbc 1 "2700b3cf8f9d35aa" (code - :constants ("scan-refs" {:upvalue-count 0 :arity 1 :constants ("list" "scan-refs-walk") :bytecode (52 0 0 0 17 1 20 1 0 16 0 16 1 48 2 5 16 1 50)} "scan-refs-walk" {:upvalue-count 0 :arity 2 :constants ("=" "type-of" "symbol" "symbol-name" "starts-with?" "~" "not" "contains?" "append!" "list" "for-each" {:upvalue-count 1 :arity 1 :constants ("scan-refs-walk") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dict" {:upvalue-count 2 :arity 1 :constants ("scan-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 49 2 50)} "keys") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 54 0 16 0 52 3 0 1 17 2 16 2 1 5 0 52 4 0 2 33 30 0 16 1 16 2 52 7 0 2 52 6 0 1 33 11 0 16 1 16 2 52 8 0 2 32 1 0 2 32 1 0 2 32 67 0 16 0 52 1 0 1 1 9 0 52 0 0 2 33 14 0 51 11 0 1 1 16 0 52 10 0 2 32 37 0 16 0 52 1 0 1 1 12 0 52 0 0 2 33 20 0 51 13 0 1 0 1 1 16 0 52 14 0 1 52 10 0 2 32 1 0 2 50)} "transitive-deps-walk" {:upvalue-count 0 :arity 3 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "island" "for-each" {:upvalue-count 2 :arity 1 :constants ("transitive-deps-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "scan-refs" "component-body" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 124 0 16 1 16 0 52 2 0 2 5 16 2 16 0 52 3 0 2 17 3 16 3 52 5 0 1 1 6 0 52 4 0 2 6 34 14 0 5 16 3 52 5 0 1 1 7 0 52 4 0 2 33 25 0 51 9 0 1 1 1 2 20 10 0 16 3 52 11 0 1 48 1 52 8 0 2 32 43 0 16 3 52 5 0 1 1 12 0 52 4 0 2 33 26 0 51 9 0 1 1 1 2 20 10 0 20 13 0 16 3 48 1 48 1 52 8 0 2 32 1 0 2 32 1 0 2 50)} "transitive-deps" {:upvalue-count 0 :arity 2 :constants ("list" "starts-with?" "~" "str" "transitive-deps-walk" "filter" {:upvalue-count 1 :arity 1 :constants ("not" "=") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)}) :bytecode (52 0 0 0 17 2 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 3 20 4 0 16 3 16 2 16 1 48 3 5 51 6 0 1 3 16 2 52 5 0 2 50)} "compute-all-deps" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 1 :arity 1 :constants ("env-get" "=" "type-of" "component" "island" "component-set-deps!" "transitive-deps") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 6 34 14 0 5 16 1 52 2 0 1 1 4 0 52 1 0 2 33 19 0 20 5 0 16 1 20 6 0 16 0 18 0 48 2 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 20 2 0 16 0 48 1 52 0 0 2 50)} "scan-components-from-source" {:upvalue-count 0 :arity 1 :constants ("regex-find-all" "\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)" "map" {:upvalue-count 0 :arity 1 :constants ("str" "~") :bytecode (1 1 0 16 0 52 0 0 2 50)}) :bytecode (20 0 0 1 1 0 16 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "components-needed" {:upvalue-count 0 :arity 2 :constants ("scan-components-from-source" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "empty?" "component-deps" "transitive-deps" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)}) :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 5 18 1 16 0 52 3 0 2 17 1 16 1 52 5 0 1 1 6 0 52 4 0 2 6 33 16 0 5 20 8 0 16 1 48 1 52 7 0 1 52 0 0 1 33 10 0 20 8 0 16 1 48 1 32 9 0 20 9 0 16 0 18 1 48 2 17 2 51 11 0 0 0 16 2 52 10 0 2 50)}) :bytecode (20 0 0 16 0 48 1 17 2 52 1 0 0 17 3 51 3 0 1 3 1 1 16 2 52 2 0 2 5 16 3 50)} "page-component-bundle" {:upvalue-count 0 :arity 2 :constants ("components-needed") :bytecode (20 0 0 16 0 16 1 49 2 50)} "page-css-classes" {:upvalue-count 0 :arity 2 :constants ("components-needed" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-css-classes") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 19 0 51 5 0 0 1 20 6 0 16 1 48 1 52 4 0 2 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-css-classes") :bytecode (20 0 0 16 0 16 1 48 2 17 2 52 1 0 0 17 3 51 3 0 1 1 1 3 16 2 52 2 0 2 5 51 4 0 1 3 20 5 0 16 0 48 1 52 2 0 2 5 16 3 50)} "scan-io-refs-walk" {:upvalue-count 0 :arity 3 :constants ("=" "type-of" "symbol" "symbol-name" "contains?" "not" "append!" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("scan-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "dict" {:upvalue-count 3 :arity 1 :constants ("scan-io-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 18 2 49 3 50)} "keys") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 33 53 0 16 0 52 3 0 1 17 3 16 1 16 3 52 4 0 2 33 30 0 16 2 16 3 52 4 0 2 52 5 0 1 33 11 0 16 2 16 3 52 6 0 2 32 1 0 2 32 1 0 2 32 71 0 16 0 52 1 0 1 1 7 0 52 0 0 2 33 16 0 51 9 0 1 1 1 2 16 0 52 8 0 2 32 39 0 16 0 52 1 0 1 1 10 0 52 0 0 2 33 22 0 51 11 0 1 0 1 1 1 2 16 0 52 12 0 1 52 8 0 2 32 1 0 2 50)} "scan-io-refs" {:upvalue-count 0 :arity 2 :constants ("list" "scan-io-refs-walk") :bytecode (52 0 0 0 17 2 20 1 0 16 0 16 1 16 2 48 3 5 16 2 50)} "transitive-io-refs-walk" {:upvalue-count 0 :arity 5 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-io-refs" "component-body" {:upvalue-count 4 :arity 1 :constants ("transitive-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 18 2 18 3 49 5 50)} "scan-refs" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 161 0 16 1 16 0 52 2 0 2 5 16 3 16 0 52 3 0 2 17 5 16 5 52 5 0 1 1 6 0 52 4 0 2 33 52 0 51 8 0 1 2 20 9 0 16 5 52 10 0 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 16 5 52 10 0 1 48 1 52 7 0 2 32 71 0 16 5 52 5 0 1 1 13 0 52 4 0 2 33 54 0 51 8 0 1 2 20 9 0 20 14 0 16 5 48 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 20 14 0 16 5 48 1 48 1 52 7 0 2 32 1 0 2 32 1 0 2 50)} "transitive-io-refs" {:upvalue-count 0 :arity 3 :constants ("list" "starts-with?" "~" "str" "transitive-io-refs-walk") :bytecode (52 0 0 0 17 3 52 0 0 0 17 4 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 5 20 4 0 16 5 16 4 16 3 16 1 16 2 48 5 5 16 3 50)} "compute-all-io-refs" {:upvalue-count 0 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "component-set-io-refs!" "transitive-io-refs") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 21 0 20 4 0 16 1 20 5 0 16 0 18 0 18 1 48 3 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 1 1 20 2 0 16 0 48 1 52 0 0 2 50)} "component-io-refs-cached" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 17 4 16 4 52 5 0 1 1 6 0 52 4 0 2 6 33 36 0 5 20 9 0 16 4 48 1 52 8 0 1 52 7 0 1 6 33 16 0 5 20 9 0 16 4 48 1 52 10 0 1 52 7 0 1 33 10 0 20 9 0 16 4 49 1 32 11 0 20 11 0 16 0 16 1 16 2 49 3 50)} "component-pure?" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 6 0 1 1 7 0 52 5 0 2 6 33 36 0 5 20 10 0 16 4 48 1 52 9 0 1 52 8 0 1 6 33 16 0 5 20 10 0 16 4 48 1 52 11 0 1 52 8 0 1 33 4 0 4 32 15 0 20 12 0 16 0 16 1 16 2 48 3 52 11 0 1 50)} "render-target" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "not" "=" "type-of" "component" "server" "component-affinity" "client" "component-pure?") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 7 0 1 1 8 0 52 6 0 2 52 5 0 1 33 6 0 1 9 0 32 71 0 16 4 52 10 0 1 17 5 16 5 1 9 0 52 6 0 2 33 6 0 1 9 0 32 45 0 16 5 1 11 0 52 6 0 2 33 6 0 1 11 0 32 27 0 20 12 0 16 0 16 1 16 2 48 3 52 5 0 1 33 6 0 1 9 0 32 3 0 1 11 0 50)} "page-render-plan" {:upvalue-count 0 :arity 3 :constants ("components-needed" "dict" "list" "for-each" {:upvalue-count 6 :arity 1 :constants ("render-target" "dict-set!" "=" "server" "append!" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-io-refs-cached") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 18 2 16 0 16 1 52 1 0 3 5 16 1 1 3 0 52 2 0 2 33 32 0 18 3 16 0 52 4 0 2 5 51 6 0 0 4 20 7 0 16 0 18 0 18 1 48 3 52 5 0 2 32 8 0 18 5 16 0 52 4 0 2 50)} "io-deps" "server" "components" "client") :bytecode (20 0 0 16 0 16 1 48 2 17 3 52 1 0 0 17 4 52 2 0 0 17 5 52 2 0 0 17 6 52 2 0 0 17 7 51 4 0 1 1 1 2 1 4 1 5 1 7 1 6 16 3 52 3 0 2 5 1 5 0 16 7 1 6 0 16 5 1 7 0 16 4 1 8 0 16 6 65 4 0 50)} "env-components" {:upvalue-count 0 :arity 1 :constants ("filter" {:upvalue-count 1 :arity 1 :constants ("env-get" "component?" "macro?") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 1 0 1 6 34 7 0 5 16 1 52 2 0 1 50)} "keys") :bytecode (51 1 0 1 0 16 0 52 2 0 1 52 0 0 2 50)} {:library (web deps) :op "import"}) :bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 1 38 0 112 50))) + :constants ("scan-refs" {:upvalue-count 0 :arity 1 :constants ("list" "scan-refs-walk") :bytecode (52 0 0 0 17 1 20 1 0 16 0 16 1 48 2 5 16 1 50)} "scan-refs-walk" {:upvalue-count 0 :arity 2 :constants ("type-of" "symbol" "=" "symbol-name" "starts-with?" "~" "not" "contains?" "append!" "list" "for-each" {:upvalue-count 1 :arity 1 :constants ("scan-refs-walk") :bytecode (20 0 0 16 0 18 0 49 2 50)} "dict" {:upvalue-count 2 :arity 1 :constants ("scan-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 49 2 50)} "keys") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 55 0 5 16 0 52 3 0 1 17 2 16 2 1 5 0 52 4 0 2 33 30 0 16 1 16 2 52 7 0 2 52 6 0 1 33 11 0 16 1 16 2 52 8 0 2 32 1 0 2 32 1 0 2 32 60 0 6 1 9 0 52 2 0 2 33 15 0 5 51 11 0 1 1 16 0 52 10 0 2 32 34 0 6 1 12 0 52 2 0 2 33 21 0 5 51 13 0 1 0 1 1 16 0 52 14 0 1 52 10 0 2 32 2 0 5 2 50)} "transitive-deps-walk" {:upvalue-count 0 :arity 3 :constants ("not" "contains?" "append!" "env-get" "type-of" "component" "=" "for-each" {:upvalue-count 2 :arity 1 :constants ("transitive-deps-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "scan-refs" "component-body" "island" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 142 0 16 1 16 0 52 2 0 2 5 16 2 16 0 52 3 0 2 17 3 16 3 52 4 0 1 6 1 5 0 52 6 0 2 33 26 0 5 51 8 0 1 1 1 2 20 9 0 16 3 52 10 0 1 48 1 52 7 0 2 32 77 0 6 1 11 0 52 6 0 2 33 26 0 5 51 8 0 1 1 1 2 20 9 0 16 3 52 10 0 1 48 1 52 7 0 2 32 40 0 6 1 12 0 52 6 0 2 33 27 0 5 51 8 0 1 1 1 2 20 9 0 20 13 0 16 3 48 1 48 1 52 7 0 2 32 2 0 5 2 32 1 0 2 50)} "transitive-deps" {:upvalue-count 0 :arity 2 :constants ("list" "starts-with?" "~" "str" "transitive-deps-walk" "filter" {:upvalue-count 1 :arity 1 :constants ("not" "=") :bytecode (16 0 18 0 52 1 0 2 52 0 0 1 50)}) :bytecode (52 0 0 0 17 2 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 3 20 4 0 16 3 16 2 16 1 48 3 5 51 6 0 1 3 16 2 52 5 0 2 50)} "compute-all-deps" {:upvalue-count 0 :arity 1 :constants ("for-each" {:upvalue-count 1 :arity 1 :constants ("env-get" "=" "type-of" "component" "island" "component-set-deps!" "transitive-deps") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 6 34 14 0 5 16 1 52 2 0 1 1 4 0 52 1 0 2 33 19 0 20 5 0 16 1 20 6 0 16 0 18 0 48 2 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 20 2 0 16 0 48 1 52 0 0 2 50)} "scan-components-from-source" {:upvalue-count 0 :arity 1 :constants ("regex-find-all" "\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)" "map" {:upvalue-count 0 :arity 1 :constants ("str" "~") :bytecode (1 1 0 16 0 52 0 0 2 50)}) :bytecode (20 0 0 1 1 0 16 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "components-needed" {:upvalue-count 0 :arity 2 :constants ("scan-components-from-source" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("not" "contains?" "append!" "env-get" "=" "type-of" "component" "empty?" "component-deps" "transitive-deps" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)}) :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 5 18 1 16 0 52 3 0 2 17 1 16 1 52 5 0 1 1 6 0 52 4 0 2 6 33 16 0 5 20 8 0 16 1 48 1 52 7 0 1 52 0 0 1 33 10 0 20 8 0 16 1 48 1 32 9 0 20 9 0 16 0 18 1 48 2 17 2 51 11 0 0 0 16 2 52 10 0 2 50)}) :bytecode (20 0 0 16 0 48 1 17 2 52 1 0 0 17 3 51 3 0 1 3 1 1 16 2 52 2 0 2 5 16 3 50)} "page-component-bundle" {:upvalue-count 0 :arity 2 :constants ("components-needed") :bytecode (20 0 0 16 0 16 1 49 2 50)} "page-css-classes" {:upvalue-count 0 :arity 2 :constants ("components-needed" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-css-classes") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 19 0 51 5 0 0 1 20 6 0 16 1 48 1 52 4 0 2 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-css-classes") :bytecode (20 0 0 16 0 16 1 48 2 17 2 52 1 0 0 17 3 51 3 0 1 1 1 3 16 2 52 2 0 2 5 51 4 0 1 3 20 5 0 16 0 48 1 52 2 0 2 5 16 3 50)} "scan-io-refs-walk" {:upvalue-count 0 :arity 3 :constants ("type-of" "symbol" "=" "symbol-name" "contains?" "not" "append!" "list" "for-each" {:upvalue-count 2 :arity 1 :constants ("scan-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 49 3 50)} "dict" {:upvalue-count 3 :arity 1 :constants ("scan-io-refs-walk" "dict-get") :bytecode (20 0 0 18 0 16 0 52 1 0 2 18 1 18 2 49 3 50)} "keys") :bytecode (16 0 52 0 0 1 6 1 1 0 52 2 0 2 33 54 0 5 16 0 52 3 0 1 17 3 16 1 16 3 52 4 0 2 33 30 0 16 2 16 3 52 4 0 2 52 5 0 1 33 11 0 16 2 16 3 52 6 0 2 32 1 0 2 32 1 0 2 32 64 0 6 1 7 0 52 2 0 2 33 17 0 5 51 9 0 1 1 1 2 16 0 52 8 0 2 32 36 0 6 1 10 0 52 2 0 2 33 23 0 5 51 11 0 1 0 1 1 1 2 16 0 52 12 0 1 52 8 0 2 32 2 0 5 2 50)} "scan-io-refs" {:upvalue-count 0 :arity 2 :constants ("list" "scan-io-refs-walk") :bytecode (52 0 0 0 17 2 20 1 0 16 0 16 1 16 2 48 3 5 16 2 50)} "transitive-io-refs-walk" {:upvalue-count 0 :arity 5 :constants ("not" "contains?" "append!" "env-get" "type-of" "component" "=" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "scan-io-refs" "component-body" {:upvalue-count 4 :arity 1 :constants ("transitive-io-refs-walk") :bytecode (20 0 0 16 0 18 0 18 1 18 2 18 3 49 5 50)} "scan-refs" "macro" "macro-body") :bytecode (16 1 16 0 52 1 0 2 52 0 0 1 33 160 0 16 1 16 0 52 2 0 2 5 16 3 16 0 52 3 0 2 17 5 16 5 52 4 0 1 6 1 5 0 52 6 0 2 33 53 0 5 51 8 0 1 2 20 9 0 16 5 52 10 0 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 16 5 52 10 0 1 48 1 52 7 0 2 32 68 0 6 1 13 0 52 6 0 2 33 55 0 5 51 8 0 1 2 20 9 0 20 14 0 16 5 48 1 16 4 48 2 52 7 0 2 5 51 11 0 1 1 1 2 1 3 1 4 20 12 0 20 14 0 16 5 48 1 48 1 52 7 0 2 32 2 0 5 2 32 1 0 2 50)} "transitive-io-refs" {:upvalue-count 0 :arity 3 :constants ("list" "starts-with?" "~" "str" "transitive-io-refs-walk") :bytecode (52 0 0 0 17 3 52 0 0 0 17 4 16 0 1 2 0 52 1 0 2 33 5 0 16 0 32 9 0 1 2 0 16 0 52 3 0 2 17 5 20 4 0 16 5 16 4 16 3 16 1 16 2 48 5 5 16 3 50)} "compute-all-io-refs" {:upvalue-count 0 :arity 2 :constants ("for-each" {:upvalue-count 2 :arity 1 :constants ("env-get" "=" "type-of" "component" "component-set-io-refs!" "transitive-io-refs") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 2 0 1 1 3 0 52 1 0 2 33 21 0 20 4 0 16 1 20 5 0 16 0 18 0 18 1 48 3 49 2 32 1 0 2 50)} "env-components") :bytecode (51 1 0 1 0 1 1 20 2 0 16 0 48 1 52 0 0 2 50)} "component-io-refs-cached" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 17 4 16 4 52 5 0 1 1 6 0 52 4 0 2 6 33 36 0 5 20 9 0 16 4 48 1 52 8 0 1 52 7 0 1 6 33 16 0 5 20 9 0 16 4 48 1 52 10 0 1 52 7 0 1 33 10 0 20 9 0 16 4 49 1 32 11 0 20 11 0 16 0 16 1 16 2 49 3 50)} "component-pure?" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "=" "type-of" "component" "not" "nil?" "component-io-refs" "empty?" "transitive-io-refs") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 6 0 1 1 7 0 52 5 0 2 6 33 36 0 5 20 10 0 16 4 48 1 52 9 0 1 52 8 0 1 6 33 16 0 5 20 10 0 16 4 48 1 52 11 0 1 52 8 0 1 33 4 0 4 32 15 0 20 12 0 16 0 16 1 16 2 48 3 52 11 0 1 50)} "render-target" {:upvalue-count 0 :arity 3 :constants ("starts-with?" "~" "str" "env-has?" "env-get" "not" "=" "type-of" "component" "server" "component-affinity" "client" "component-pure?") :bytecode (16 0 1 1 0 52 0 0 2 33 5 0 16 0 32 9 0 1 1 0 16 0 52 2 0 2 17 3 16 1 16 3 52 3 0 2 33 11 0 16 1 16 3 52 4 0 2 32 1 0 2 17 4 16 4 52 7 0 1 1 8 0 52 6 0 2 52 5 0 1 33 6 0 1 9 0 32 70 0 16 4 52 10 0 1 6 1 9 0 52 6 0 2 33 7 0 5 1 9 0 32 46 0 6 1 11 0 52 6 0 2 33 7 0 5 1 11 0 32 28 0 5 20 12 0 16 0 16 1 16 2 48 3 52 5 0 1 33 6 0 1 9 0 32 3 0 1 11 0 50)} "page-render-plan" {:upvalue-count 0 :arity 3 :constants ("components-needed" "dict" "list" "for-each" {:upvalue-count 6 :arity 1 :constants ("render-target" "dict-set!" "=" "server" "append!" "for-each" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "append!") :bytecode (18 0 16 0 52 1 0 2 52 0 0 1 33 11 0 18 0 16 0 52 2 0 2 32 1 0 2 50)} "component-io-refs-cached") :bytecode (20 0 0 16 0 18 0 18 1 48 3 17 1 18 2 16 0 16 1 52 1 0 3 5 16 1 1 3 0 52 2 0 2 33 32 0 18 3 16 0 52 4 0 2 5 51 6 0 0 4 20 7 0 16 0 18 0 18 1 48 3 52 5 0 2 32 8 0 18 5 16 0 52 4 0 2 50)} "io-deps" "server" "components" "client") :bytecode (20 0 0 16 0 16 1 48 2 17 3 52 1 0 0 17 4 52 2 0 0 17 5 52 2 0 0 17 6 52 2 0 0 17 7 51 4 0 1 1 1 2 1 4 1 5 1 7 1 6 16 3 52 3 0 2 5 1 5 0 16 7 1 6 0 16 5 1 7 0 16 4 1 8 0 16 6 65 4 0 50)} "env-components" {:upvalue-count 0 :arity 1 :constants ("filter" {:upvalue-count 1 :arity 1 :constants ("env-get" "component?" "macro?") :bytecode (18 0 16 0 52 0 0 2 17 1 16 1 52 1 0 1 6 34 7 0 5 16 1 52 2 0 1 50)} "keys") :bytecode (51 1 0 1 0 16 0 52 2 0 1 52 0 0 2 50)} {:library (web deps) :op "import"}) :bytecode (51 1 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 1 38 0 112 50))) diff --git a/shared/static/wasm/sx/engine.sx b/shared/static/wasm/sx/engine.sx index 42a00f7d..207abff3 100644 --- a/shared/static/wasm/sx/engine.sx +++ b/shared/static/wasm/sx/engine.sx @@ -4,7 +4,8 @@ (import (sx dom)) (import (sx browser)) -(define-library (web engine) +(define-library + (web engine) (export ENGINE_VERBS DEFAULT_SWAP @@ -40,818 +41,802 @@ should-boost-form? parse-sse-swap) (begin - -(define ENGINE_VERBS (list "get" "post" "put" "delete" "patch")) - -(define DEFAULT_SWAP "outerHTML") - -(define - parse-time - :effects () - (fn - ((s :as string)) - (if - (nil? s) - 0 - (if - (ends-with? s "ms") - (parse-int s 0) - (if - (ends-with? s "s") - (* (parse-int (replace s "s" "") 0) 1000) - (parse-int s 0)))))) - -(define - parse-trigger-spec - :effects () - (fn - ((spec :as string)) - (if - (nil? spec) - nil - (let - ((raw-parts (split spec ","))) - (filter - (fn (x) (not (nil? x))) - (map - (fn - ((part :as string)) - (let - ((tokens (split (trim part) " "))) - (if - (empty? tokens) - nil - (if - (and (= (first tokens) "every") (>= (len tokens) 2)) - (dict - "event" - "every" - "modifiers" - (dict "interval" (parse-time (nth tokens 1)))) - (let - ((mods (dict))) - (for-each - (fn - ((tok :as string)) - (cond - (= tok "once") - (dict-set! mods "once" true) - (= tok "changed") - (dict-set! mods "changed" true) - (starts-with? tok "delay:") - (dict-set! - mods - "delay" - (parse-time (slice tok 6))) - (starts-with? tok "from:") - (dict-set! mods "from" (slice tok 5)))) - (rest tokens)) - (let - ((raw-event (first tokens))) - (let - ((bracket-idx (index-of raw-event "["))) - (if - (>= bracket-idx 0) - (do - (dict-set! - mods - "filter" - (slice - raw-event - (+ bracket-idx 1) - (- (len raw-event) 1))) - (dict - "event" - (slice raw-event 0 bracket-idx) - "modifiers" - mods)) - (dict "event" raw-event "modifiers" mods))))))))) - raw-parts)))))) - -(define - default-trigger - :effects () - (fn - ((tag-name :as string)) - (cond - (= tag-name "form") - (list (dict "event" "submit" "modifiers" (dict))) - (or - (= tag-name "input") - (= tag-name "select") - (= tag-name "textarea")) - (list (dict "event" "change" "modifiers" (dict))) - :else (list (dict "event" "click" "modifiers" (dict)))))) - -(define - get-verb-info - :effects (io) - (fn - (el) - (some + (define ENGINE_VERBS (list "get" "post" "put" "delete" "patch")) + (define DEFAULT_SWAP "outerHTML") + (define + parse-time + :effects () (fn - (verb) - (let - ((url (dom-get-attr el (str "sx-" verb)))) - (if url (dict "method" (upper verb) "url" url) nil))) - ENGINE_VERBS))) - -(define - build-request-headers - :effects (io) - (fn - (el (loaded-components :as list)) - (let - ((headers (dict "SX-Request" "true" "SX-Current-URL" (browser-location-href)))) - (let - ((target-sel (dom-get-attr el "sx-target"))) - (when target-sel (dict-set! headers "SX-Target" target-sel))) - (let - ((comp-hash (dom-get-attr (dom-query "script[data-components][data-hash]") "data-hash"))) - (when comp-hash (dict-set! headers "SX-Components-Hash" comp-hash))) - (let - ((extra-h (dom-get-attr el "sx-headers"))) - (when - extra-h - (let - ((parsed (parse-header-value extra-h))) - (when - parsed - (for-each - (fn - ((key :as string)) - (dict-set! headers key (str (get parsed key)))) - (keys parsed)))))) - headers))) - -(define - process-response-headers - :effects () - (fn - ((get-header :as lambda)) - (dict - "redirect" - (get-header "SX-Redirect") - "refresh" - (get-header "SX-Refresh") - "trigger" - (get-header "SX-Trigger") - "retarget" - (get-header "SX-Retarget") - "reswap" - (get-header "SX-Reswap") - "location" - (get-header "SX-Location") - "replace-url" - (get-header "SX-Replace-Url") - "trigger-swap" - (get-header "SX-Trigger-After-Swap") - "trigger-settle" - (get-header "SX-Trigger-After-Settle") - "content-type" - (get-header "Content-Type") - "cache-invalidate" - (get-header "SX-Cache-Invalidate") - "cache-update" - (get-header "SX-Cache-Update")))) - -(define - parse-swap-spec - :effects () - (fn - ((raw-swap :as string) (global-transitions? :as boolean)) - (let - ((parts (split (or raw-swap DEFAULT_SWAP) " ")) - (style (first parts)) - (use-transition global-transitions?)) - (for-each - (fn - ((p :as string)) - (cond - (= p "transition:true") - (set! use-transition true) - (= p "transition:false") - (set! use-transition false))) - (rest parts)) - (dict "style" style "transition" use-transition)))) - -(define - parse-retry-spec - :effects () - (fn - ((retry-attr :as string)) - (if - (nil? retry-attr) - nil - (let - ((parts (split retry-attr ":"))) - (dict - "strategy" - (first parts) - "start-ms" - (parse-int (nth parts 1) 1000) - "cap-ms" - (parse-int (nth parts 2) 30000)))))) - -(define - next-retry-ms - :effects () - (fn - ((current-ms :as number) (cap-ms :as number)) - (min (* current-ms 2) cap-ms))) - -(define - filter-params - :effects () - (fn - ((params-spec :as string) (all-params :as list)) - (if - (nil? params-spec) - all-params - (if - (= params-spec "none") - (list) + ((s :as string)) (if - (= params-spec "*") + (nil? s) + 0 + (if + (ends-with? s "ms") + (parse-int s 0) + (if + (ends-with? s "s") + (* (parse-int (replace s "s" "") 0) 1000) + (parse-int s 0)))))) + (define + parse-trigger-spec + :effects () + (fn + ((spec :as string)) + (if + (nil? spec) + nil + (let + ((raw-parts (split spec ","))) + (filter + (fn (x) (not (nil? x))) + (map + (fn + ((part :as string)) + (let + ((tokens (split (trim part) " "))) + (if + (empty? tokens) + nil + (if + (and + (= (first tokens) "every") + (>= (len tokens) 2)) + (dict + "event" + "every" + "modifiers" + (dict "interval" (parse-time (nth tokens 1)))) + (let + ((mods (dict))) + (for-each + (fn + ((tok :as string)) + (cond + (= tok "once") + (dict-set! mods "once" true) + (= tok "changed") + (dict-set! mods "changed" true) + (starts-with? tok "delay:") + (dict-set! + mods + "delay" + (parse-time (slice tok 6))) + (starts-with? tok "from:") + (dict-set! mods "from" (slice tok 5)))) + (rest tokens)) + (let + ((raw-event (first tokens))) + (let + ((bracket-idx (index-of raw-event "["))) + (if + (>= bracket-idx 0) + (do + (dict-set! + mods + "filter" + (slice + raw-event + (+ bracket-idx 1) + (- (len raw-event) 1))) + (dict + "event" + (slice raw-event 0 bracket-idx) + "modifiers" + mods)) + (dict "event" raw-event "modifiers" mods))))))))) + raw-parts)))))) + (define + default-trigger + :effects () + (fn + ((tag-name :as string)) + (match + tag-name + ("form" (list (dict "event" "submit" "modifiers" (dict)))) + ("input" (list (dict "event" "change" "modifiers" (dict)))) + ("select" (list (dict "event" "change" "modifiers" (dict)))) + ("textarea" (list (dict "event" "change" "modifiers" (dict)))) + (_ (list (dict "event" "click" "modifiers" (dict))))))) + (define + get-verb-info + :effects (io) + (fn + (el) + (some + (fn + (verb) + (let + ((url (dom-get-attr el (str "sx-" verb)))) + (if url (dict "method" (upper verb) "url" url) nil))) + ENGINE_VERBS))) + (define + build-request-headers + :effects (io) + (fn + (el (loaded-components :as list)) + (let + ((headers (dict "SX-Request" "true" "SX-Current-URL" (browser-location-href)))) + (let + ((target-sel (dom-get-attr el "sx-target"))) + (when target-sel (dict-set! headers "SX-Target" target-sel))) + (let + ((comp-hash (dom-get-attr (dom-query "script[data-components][data-hash]") "data-hash"))) + (when + comp-hash + (dict-set! headers "SX-Components-Hash" comp-hash))) + (let + ((extra-h (dom-get-attr el "sx-headers"))) + (when + extra-h + (let + ((parsed (parse-header-value extra-h))) + (when + parsed + (for-each + (fn + ((key :as string)) + (dict-set! headers key (str (get parsed key)))) + (keys parsed)))))) + headers))) + (define + process-response-headers + :effects () + (fn + ((get-header :as lambda)) + (dict + "redirect" + (get-header "SX-Redirect") + "refresh" + (get-header "SX-Refresh") + "trigger" + (get-header "SX-Trigger") + "retarget" + (get-header "SX-Retarget") + "reswap" + (get-header "SX-Reswap") + "location" + (get-header "SX-Location") + "replace-url" + (get-header "SX-Replace-Url") + "trigger-swap" + (get-header "SX-Trigger-After-Swap") + "trigger-settle" + (get-header "SX-Trigger-After-Settle") + "content-type" + (get-header "Content-Type") + "cache-invalidate" + (get-header "SX-Cache-Invalidate") + "cache-update" + (get-header "SX-Cache-Update")))) + (define + parse-swap-spec + :effects () + (fn + ((raw-swap :as string) (global-transitions? :as boolean)) + (let + ((parts (split (or raw-swap DEFAULT_SWAP) " ")) + (style (first parts)) + (use-transition global-transitions?)) + (for-each + (fn + ((p :as string)) + (cond + (= p "transition:true") + (set! use-transition true) + (= p "transition:false") + (set! use-transition false))) + (rest parts)) + (dict "style" style "transition" use-transition)))) + (define + parse-retry-spec + :effects () + (fn + ((retry-attr :as string)) + (if + (nil? retry-attr) + nil + (let + ((parts (split retry-attr ":"))) + (dict + "strategy" + (first parts) + "start-ms" + (parse-int (nth parts 1) 1000) + "cap-ms" + (parse-int (nth parts 2) 30000)))))) + (define + next-retry-ms + :effects () + (fn + ((current-ms :as number) (cap-ms :as number)) + (min (* current-ms 2) cap-ms))) + (define + filter-params + :effects () + (fn + ((params-spec :as string) (all-params :as list)) + (if + (nil? params-spec) all-params (if - (starts-with? params-spec "not ") - (let - ((excluded (map trim (split (slice params-spec 4) ",")))) - (filter - (fn ((p :as list)) (not (contains? excluded (first p)))) - all-params)) - (let - ((allowed (map trim (split params-spec ",")))) - (filter - (fn ((p :as list)) (contains? allowed (first p))) - all-params)))))))) - -(define - resolve-target - :effects (io) - (fn - (el) - (let - ((sel (dom-get-attr el "sx-target"))) - (cond - (or (nil? sel) (= sel "this")) - el - (= sel "closest") - (dom-parent el) - :else (dom-query sel))))) - -(define - apply-optimistic - :effects (mutation io) - (fn - (el) - (let - ((directive (dom-get-attr el "sx-optimistic"))) - (if - (nil? directive) - nil - (let - ((target (or (resolve-target el) el)) - (state (dict "target" target "directive" directive))) - (cond - (= directive "remove") - (do - (dict-set! state "opacity" (dom-get-style target "opacity")) - (dom-set-style target "opacity" "0") - (dom-set-style target "pointer-events" "none")) - (= directive "disable") - (do - (dict-set! state "disabled" (dom-get-prop target "disabled")) - (dom-set-prop target "disabled" true)) - (starts-with? directive "add-class:") - (let - ((cls (slice directive 10))) - (dict-set! state "add-class" cls) - (dom-add-class target cls))) - state))))) - -(define - revert-optimistic - :effects (mutation io) - (fn - ((state :as dict)) - (when - state - (let - ((target (get state "target")) (directive (get state "directive"))) - (cond - (= directive "remove") - (do - (dom-set-style target "opacity" (or (get state "opacity") "")) - (dom-set-style target "pointer-events" "")) - (= directive "disable") - (dom-set-prop target "disabled" (or (get state "disabled") false)) - (get state "add-class") - (dom-remove-class target (get state "add-class"))))))) - -(define - find-oob-swaps - :effects (mutation io) - (fn - (container) - (let - ((results (list))) - (for-each - (fn - ((attr :as string)) - (let - ((oob-els (dom-query-all container (str "[" attr "]")))) - (for-each - (fn - (oob) + (= params-spec "none") + (list) + (if + (= params-spec "*") + all-params + (if + (starts-with? params-spec "not ") (let - ((swap-type (or (dom-get-attr oob attr) "outerHTML")) - (target-id (dom-id oob))) - (dom-remove-attr oob attr) - (when - target-id - (append! - results - (dict - "element" - oob - "swap-type" - swap-type - "target-id" - target-id))))) - oob-els))) - (list "sx-swap-oob" "hx-swap-oob")) - results))) - -(define - morph-node - :effects (mutation io) - (fn - (old-node new-node) - (cond - (or - (dom-has-attr? old-node "sx-preserve") - (dom-has-attr? old-node "sx-ignore")) - nil - (and - (dom-has-attr? old-node "data-sx-island") - (is-processed? old-node "island-hydrated") - (dom-has-attr? new-node "data-sx-island") - (= - (dom-get-attr old-node "data-sx-island") - (dom-get-attr new-node "data-sx-island"))) - (let - ((old-state (dom-get-attr old-node "data-sx-state")) - (new-state (dom-get-attr new-node "data-sx-state"))) - (sync-attrs old-node new-node) - (if - (and new-state (not (= old-state new-state))) - (do (dispose-island old-node) (hydrate-island old-node)) - (morph-island-children old-node new-node))) - (or - (not (= (dom-node-type old-node) (dom-node-type new-node))) - (not (= (dom-node-name old-node) (dom-node-name new-node)))) - (dom-replace-child - (dom-parent old-node) - (dom-clone new-node true) - old-node) - (or (= (dom-node-type old-node) 3) (= (dom-node-type old-node) 8)) - (when - (not (= (dom-text-content old-node) (dom-text-content new-node))) - (dom-set-text-content old-node (dom-text-content new-node))) - (= (dom-node-type old-node) 1) - (do + ((excluded (map trim (split (slice params-spec 4) ",")))) + (filter + (fn + ((p :as list)) + (not (contains? excluded (first p)))) + all-params)) + (let + ((allowed (map trim (split params-spec ",")))) + (filter + (fn ((p :as list)) (contains? allowed (first p))) + all-params)))))))) + (define + resolve-target + :effects (io) + (fn + (el) + (let + ((sel (dom-get-attr el "sx-target"))) + (match + sel + (nil el) + ("this" el) + ("closest" (dom-parent el)) + (_ (dom-query sel)))))) + (define + apply-optimistic + :effects (mutation io) + (fn + (el) + (let + ((directive (dom-get-attr el "sx-optimistic"))) + (if + (nil? directive) + nil + (let + ((target (or (resolve-target el) el)) + (state (dict "target" target "directive" directive))) + (cond + (= directive "remove") + (do + (dict-set! state "opacity" (dom-get-style target "opacity")) + (dom-set-style target "opacity" "0") + (dom-set-style target "pointer-events" "none")) + (= directive "disable") + (do + (dict-set! + state + "disabled" + (dom-get-prop target "disabled")) + (dom-set-prop target "disabled" true)) + (starts-with? directive "add-class:") + (let + ((cls (slice directive 10))) + (dict-set! state "add-class" cls) + (dom-add-class target cls))) + state))))) + (define + revert-optimistic + :effects (mutation io) + (fn + ((state :as dict)) (when + state + (let + ((target (get state "target")) + (directive (get state "directive"))) + (cond + (= directive "remove") + (do + (dom-set-style + target + "opacity" + (or (get state "opacity") "")) + (dom-set-style target "pointer-events" "")) + (= directive "disable") + (dom-set-prop + target + "disabled" + (or (get state "disabled") false)) + (get state "add-class") + (dom-remove-class target (get state "add-class"))))))) + (define + find-oob-swaps + :effects (mutation io) + (fn + (container) + (let + ((results (list))) + (for-each + (fn + ((attr :as string)) + (let + ((oob-els (dom-query-all container (str "[" attr "]")))) + (for-each + (fn + (oob) + (let + ((swap-type (or (dom-get-attr oob attr) "outerHTML")) + (target-id (dom-id oob))) + (dom-remove-attr oob attr) + (when + target-id + (append! + results + (dict + "element" + oob + "swap-type" + swap-type + "target-id" + target-id))))) + oob-els))) + (list "sx-swap-oob" "hx-swap-oob")) + results))) + (define + morph-node + :effects (mutation io) + (fn + (old-node new-node) + (cond + (or + (dom-has-attr? old-node "sx-preserve") + (dom-has-attr? old-node "sx-ignore")) + nil (and (dom-has-attr? old-node "data-sx-island") + (is-processed? old-node "island-hydrated") (dom-has-attr? new-node "data-sx-island") + (= + (dom-get-attr old-node "data-sx-island") + (dom-get-attr new-node "data-sx-island"))) + (let + ((old-state (dom-get-attr old-node "data-sx-state")) + (new-state (dom-get-attr new-node "data-sx-state"))) + (sync-attrs old-node new-node) + (if + (and new-state (not (= old-state new-state))) + (do (dispose-island old-node) (hydrate-island old-node)) + (morph-island-children old-node new-node))) + (or + (not (= (dom-node-type old-node) (dom-node-type new-node))) + (not (= (dom-node-name old-node) (dom-node-name new-node)))) + (dom-replace-child + (dom-parent old-node) + (dom-clone new-node true) + old-node) + (or + (= (dom-node-type old-node) 3) + (= (dom-node-type old-node) 8)) + (when (not - (= - (dom-get-attr old-node "data-sx-island") - (dom-get-attr new-node "data-sx-island")))) - (dispose-island old-node) - (dispose-islands-in old-node)) - (sync-attrs old-node new-node) - (when - (not - (and - (dom-is-active-element? old-node) - (dom-is-input-element? old-node))) - (morph-children old-node new-node)))))) - -(define - sync-attrs - :effects (mutation io) - (fn - (old-el new-el) - (let - ((ra-str (or (dom-get-attr old-el "data-sx-reactive-attrs") "")) - (reactive-attrs (if (empty? ra-str) (list) (split ra-str ",")))) - (for-each - (fn - ((attr :as list)) - (let - ((name (first attr)) (val (nth attr 1))) + (= (dom-text-content old-node) (dom-text-content new-node))) + (dom-set-text-content old-node (dom-text-content new-node))) + (= (dom-node-type old-node) 1) + (do (when (and - (not (= (dom-get-attr old-el name) val)) - (not (contains? reactive-attrs name))) - (dom-set-attr old-el name val)))) - (dom-attr-list new-el)) - (for-each - (fn - ((attr :as list)) - (let - ((aname (first attr))) + (dom-has-attr? old-node "data-sx-island") + (dom-has-attr? new-node "data-sx-island") + (not + (= + (dom-get-attr old-node "data-sx-island") + (dom-get-attr new-node "data-sx-island")))) + (dispose-island old-node) + (dispose-islands-in old-node)) + (sync-attrs old-node new-node) (when - (and - (not (dom-has-attr? new-el aname)) - (not (contains? reactive-attrs aname)) - (not (= aname "data-sx-reactive-attrs"))) - (dom-remove-attr old-el aname)))) - (dom-attr-list old-el))))) - -(define - morph-children - :effects (mutation io) - (fn - (old-parent new-parent) - (let - ((old-kids (dom-child-list old-parent)) - (new-kids (dom-child-list new-parent)) - (old-by-id (dict)) - (old-idx-by-id (dict)) - (consumed (dict)) - (oi 0) - (idx 0)) - (for-each - (fn - (kid) - (let - ((id (dom-id kid))) - (when - (and id (not (empty? id))) - (dict-set! old-by-id id kid) - (dict-set! old-idx-by-id id idx))) - (set! idx (inc idx))) - old-kids) - (for-each - (fn - (new-child) - (let - ((raw-id (dom-id new-child)) - (match-id (if (and raw-id (not (empty? raw-id))) raw-id nil)) - (match-by-id (if match-id (dict-get old-by-id match-id) nil))) - (cond - (and match-by-id (not (nil? match-by-id))) - (do - (let - ((matched-idx (dict-get old-idx-by-id match-id))) - (when - matched-idx - (dict-set! consumed (str matched-idx) true))) + (not + (and + (dom-is-active-element? old-node) + (dom-is-input-element? old-node))) + (morph-children old-node new-node)))))) + (define + sync-attrs + :effects (mutation io) + (fn + (old-el new-el) + (let + ((ra-str (or (dom-get-attr old-el "data-sx-reactive-attrs") "")) + (reactive-attrs (if (empty? ra-str) (list) (split ra-str ",")))) + (for-each + (fn + ((attr :as list)) + (let + ((name (first attr)) (val (nth attr 1))) (when (and - (< oi (len old-kids)) - (not (= match-by-id (nth old-kids oi)))) - (dom-insert-before - old-parent - match-by-id - (if (< oi (len old-kids)) (nth old-kids oi) nil))) - (morph-node match-by-id new-child) - (set! oi (inc oi))) - (< oi (len old-kids)) + (not (= (dom-get-attr old-el name) val)) + (not (contains? reactive-attrs name))) + (dom-set-attr old-el name val)))) + (dom-attr-list new-el)) + (for-each + (fn + ((attr :as list)) (let - ((old-child (nth old-kids oi))) - (let - ((old-id (dom-id old-child))) - (if - (and old-id (not (empty? old-id)) (not match-id)) - (dom-insert-before - old-parent - (dom-clone new-child true) - old-child) - (do - (dict-set! consumed (str oi) true) - (morph-node old-child new-child) - (set! oi (inc oi)))))) - :else (dom-append old-parent (dom-clone new-child true))))) - new-kids) - (for-each - (fn - (i) - (when - (not (dict-get consumed (str i))) - (let - ((leftover (nth old-kids i))) - (when - (and - (dom-is-child-of? leftover old-parent) - (not (dom-has-attr? leftover "sx-preserve")) - (not (dom-has-attr? leftover "sx-ignore"))) - (dom-remove-child old-parent leftover))))) - (range 0 (len old-kids)))))) - -(define - morph-island-children - :effects (mutation io) - (fn - (old-island new-island) - (let - ((old-lakes (dom-query-all old-island "[data-sx-lake]")) - (new-lakes (dom-query-all new-island "[data-sx-lake]")) - (old-marshes (dom-query-all old-island "[data-sx-marsh]")) - (new-marshes (dom-query-all new-island "[data-sx-marsh]"))) - (let - ((new-lake-map (dict)) (new-marsh-map (dict))) - (for-each - (fn - (lake) - (let - ((id (dom-get-attr lake "data-sx-lake"))) - (when id (dict-set! new-lake-map id lake)))) - new-lakes) - (for-each - (fn - (marsh) - (let - ((id (dom-get-attr marsh "data-sx-marsh"))) - (when id (dict-set! new-marsh-map id marsh)))) - new-marshes) - (for-each - (fn - (old-lake) - (let - ((id (dom-get-attr old-lake "data-sx-lake"))) - (let - ((new-lake (dict-get new-lake-map id))) + ((aname (first attr))) (when - new-lake - (sync-attrs old-lake new-lake) - (morph-children old-lake new-lake))))) - old-lakes) - (for-each - (fn - (old-marsh) - (let - ((id (dom-get-attr old-marsh "data-sx-marsh"))) - (let - ((new-marsh (dict-get new-marsh-map id))) - (when new-marsh (morph-marsh old-marsh new-marsh old-island))))) - old-marshes) - (process-signal-updates new-island))))) - -(define - morph-marsh - :effects (mutation io) - (fn - (old-marsh new-marsh island-el) - (let - ((transform (dom-get-data old-marsh "sx-marsh-transform")) - (env (dom-get-data old-marsh "sx-marsh-env")) - (new-html (dom-inner-html new-marsh))) - (if - (and env new-html (not (empty? new-html))) + (and + (not (dom-has-attr? new-el aname)) + (not (contains? reactive-attrs aname)) + (not (= aname "data-sx-reactive-attrs"))) + (dom-remove-attr old-el aname)))) + (dom-attr-list old-el))))) + (define + morph-children + :effects (mutation io) + (fn + (old-parent new-parent) (let - ((parsed (parse new-html))) - (let - ((sx-content (if transform (cek-call transform (list parsed)) parsed))) - (dispose-marsh-scope old-marsh) - (with-marsh-scope - old-marsh - (fn - () - (let - ((new-dom (render-to-dom sx-content env nil))) - (dom-remove-children-after old-marsh nil) - (dom-append old-marsh new-dom)))))) - (do - (sync-attrs old-marsh new-marsh) - (morph-children old-marsh new-marsh)))))) - -(define - process-signal-updates - :effects (mutation io) - (fn - (root) - (let - ((signal-els (dom-query-all root "[data-sx-signal]"))) - (for-each - (fn - (el) - (let - ((spec (dom-get-attr el "data-sx-signal"))) - (when - spec + ((old-kids (dom-child-list old-parent)) + (new-kids (dom-child-list new-parent)) + (old-by-id (dict)) + (old-idx-by-id (dict)) + (consumed (dict)) + (oi 0) + (idx 0)) + (for-each + (fn + (kid) (let - ((colon-idx (index-of spec ":"))) + ((id (dom-id kid))) (when - (> colon-idx 0) - (let - ((store-name (slice spec 0 colon-idx)) - (raw-value (slice spec (+ colon-idx 1)))) + (and id (not (empty? id))) + (dict-set! old-by-id id kid) + (dict-set! old-idx-by-id id idx))) + (set! idx (inc idx))) + old-kids) + (for-each + (fn + (new-child) + (let + ((raw-id (dom-id new-child)) + (match-id + (if (and raw-id (not (empty? raw-id))) raw-id nil)) + (match-by-id + (if match-id (dict-get old-by-id match-id) nil))) + (cond + (and match-by-id (not (nil? match-by-id))) + (do (let - ((parsed (json-parse raw-value))) - (reset! (use-store store-name) parsed)) - (dom-remove-attr el "data-sx-signal"))))))) - signal-els)))) - -(define - swap-dom-nodes - :effects (mutation io) - (fn - (target new-nodes (strategy :as string)) - (case - strategy - "innerHTML" - (if - (dom-is-fragment? new-nodes) - (morph-children target new-nodes) - (let - ((wrapper (dom-create-element "div" nil))) - (dom-append wrapper new-nodes) - (morph-children target wrapper))) - "outerHTML" - (let - ((parent (dom-parent target)) (new-el (dom-clone new-nodes true))) - (if - (dom-is-fragment? new-nodes) - (let - ((fc (dom-first-child new-nodes))) - (if - fc - (do - (set! new-el (dom-clone fc true)) - (dom-replace-child parent new-el target) + ((matched-idx (dict-get old-idx-by-id match-id))) + (when + matched-idx + (dict-set! consumed (str matched-idx) true))) + (when + (and + (< oi (len old-kids)) + (not (= match-by-id (nth old-kids oi)))) + (dom-insert-before + old-parent + match-by-id + (if (< oi (len old-kids)) (nth old-kids oi) nil))) + (morph-node match-by-id new-child) + (set! oi (inc oi))) + (< oi (len old-kids)) + (let + ((old-child (nth old-kids oi))) + (let + ((old-id (dom-id old-child))) + (if + (and old-id (not (empty? old-id)) (not match-id)) + (dom-insert-before + old-parent + (dom-clone new-child true) + old-child) + (do + (dict-set! consumed (str oi) true) + (morph-node old-child new-child) + (set! oi (inc oi)))))) + :else (dom-append old-parent (dom-clone new-child true))))) + new-kids) + (for-each + (fn + (i) + (when + (not (dict-get consumed (str i))) (let - ((sib (dom-next-sibling fc))) - (insert-remaining-siblings parent new-el sib))) - (dom-remove-child parent target))) - (dom-replace-child parent new-el target)) - new-el) - "afterend" - (dom-insert-after target new-nodes) - "beforeend" - (dom-append target new-nodes) - "afterbegin" - (dom-prepend target new-nodes) - "beforebegin" - (dom-insert-before (dom-parent target) new-nodes target) - "delete" - (dom-remove-child (dom-parent target) target) - "none" - nil - :else (if - (dom-is-fragment? new-nodes) - (morph-children target new-nodes) + ((leftover (nth old-kids i))) + (when + (and + (dom-is-child-of? leftover old-parent) + (not (dom-has-attr? leftover "sx-preserve")) + (not (dom-has-attr? leftover "sx-ignore"))) + (dom-remove-child old-parent leftover))))) + (range 0 (len old-kids)))))) + (define + morph-island-children + :effects (mutation io) + (fn + (old-island new-island) (let - ((wrapper (dom-create-element "div" nil))) - (dom-append wrapper new-nodes) - (morph-children target wrapper)))))) - -(define - insert-remaining-siblings - :effects (mutation io) - (fn - (parent ref-node sib) - (when - sib - (let - ((next (dom-next-sibling sib))) - (dom-insert-after ref-node sib) - (insert-remaining-siblings parent sib next))))) - -(define - swap-html-string - :effects (mutation io) - (fn - (target (html :as string) (strategy :as string)) - (case - strategy - "innerHTML" - (dom-set-inner-html target html) - "outerHTML" - (let - ((parent (dom-parent target))) - (dom-insert-adjacent-html target "afterend" html) - (dom-remove-child parent target) - parent) - "afterend" - (dom-insert-adjacent-html target "afterend" html) - "beforeend" - (dom-insert-adjacent-html target "beforeend" html) - "afterbegin" - (dom-insert-adjacent-html target "afterbegin" html) - "beforebegin" - (dom-insert-adjacent-html target "beforebegin" html) - "delete" - (dom-remove-child (dom-parent target) target) - "none" - nil - :else (dom-set-inner-html target html)))) - -(define - handle-history - :effects (io) - (fn - (el (url :as string) (resp-headers :as dict)) - (let - ((push-url (dom-get-attr el "sx-push-url")) - (replace-url (dom-get-attr el "sx-replace-url")) - (hdr-replace (get resp-headers "replace-url"))) - (cond - hdr-replace - (browser-replace-state hdr-replace) - (and push-url (not (= push-url "false"))) - (do - (save-scroll-position) - (browser-push-state (if (= push-url "true") url push-url))) - (and replace-url (not (= replace-url "false"))) - (browser-replace-state (if (= replace-url "true") url replace-url)))))) - -(define PRELOAD_TTL 30000) - -(define - preload-cache-get - :effects (mutation) - (fn - ((cache :as dict) (url :as string)) - (let - ((entry (dict-get cache url))) - (if - (nil? entry) - nil - (if - (> (- (now-ms) (get entry "timestamp")) PRELOAD_TTL) - (do (dict-delete! cache url) nil) - (do (dict-delete! cache url) entry)))))) - -(define - preload-cache-set - :effects (mutation) - (fn - ((cache :as dict) - (url :as string) - (text :as string) - (content-type :as string)) - (dict-set! - cache - url - (dict "text" text "content-type" content-type "timestamp" (now-ms))))) - -(define - classify-trigger - :effects () - (fn - ((trigger :as dict)) - (let - ((event (get trigger "event"))) - (cond - (= event "every") - "poll" - (= event "intersect") - "intersect" - (= event "load") - "load" - (= event "revealed") - "revealed" - :else "event")))) - -(define - should-boost-link? - :effects (io) - (fn - (link) - (let - ((href (dom-get-attr link "href"))) - (and - href - (not (starts-with? href "#")) - (not (starts-with? href "javascript:")) - (not (starts-with? href "mailto:")) - (browser-same-origin? href) - (not (dom-has-attr? link "sx-get")) - (not (dom-has-attr? link "sx-post")) - (not (dom-has-attr? link "sx-disable")))))) - -(define - should-boost-form? - :effects (io) - (fn - (form) - (and - (not (dom-has-attr? form "sx-get")) - (not (dom-has-attr? form "sx-post")) - (not (dom-has-attr? form "sx-disable"))))) - -(define - parse-sse-swap - :effects (io) - (fn (el) (or (dom-get-attr el "sx-sse-swap") "message"))) - - -)) ;; end define-library + ((old-lakes (dom-query-all old-island "[data-sx-lake]")) + (new-lakes (dom-query-all new-island "[data-sx-lake]")) + (old-marshes (dom-query-all old-island "[data-sx-marsh]")) + (new-marshes (dom-query-all new-island "[data-sx-marsh]"))) + (let + ((new-lake-map (dict)) (new-marsh-map (dict))) + (for-each + (fn + (lake) + (let + ((id (dom-get-attr lake "data-sx-lake"))) + (when id (dict-set! new-lake-map id lake)))) + new-lakes) + (for-each + (fn + (marsh) + (let + ((id (dom-get-attr marsh "data-sx-marsh"))) + (when id (dict-set! new-marsh-map id marsh)))) + new-marshes) + (for-each + (fn + (old-lake) + (let + ((id (dom-get-attr old-lake "data-sx-lake"))) + (let + ((new-lake (dict-get new-lake-map id))) + (when + new-lake + (sync-attrs old-lake new-lake) + (morph-children old-lake new-lake))))) + old-lakes) + (for-each + (fn + (old-marsh) + (let + ((id (dom-get-attr old-marsh "data-sx-marsh"))) + (let + ((new-marsh (dict-get new-marsh-map id))) + (when + new-marsh + (morph-marsh old-marsh new-marsh old-island))))) + old-marshes) + (process-signal-updates new-island))))) + (define + morph-marsh + :effects (mutation io) + (fn + (old-marsh new-marsh island-el) + (let + ((transform (dom-get-data old-marsh "sx-marsh-transform")) + (env (dom-get-data old-marsh "sx-marsh-env")) + (new-html (dom-inner-html new-marsh))) + (if + (and env new-html (not (empty? new-html))) + (let + ((parsed (parse new-html))) + (let + ((sx-content (if transform (cek-call transform (list parsed)) parsed))) + (dispose-marsh-scope old-marsh) + (with-marsh-scope + old-marsh + (fn + () + (let + ((new-dom (render-to-dom sx-content env nil))) + (dom-remove-children-after old-marsh nil) + (dom-append old-marsh new-dom)))))) + (do + (sync-attrs old-marsh new-marsh) + (morph-children old-marsh new-marsh)))))) + (define + process-signal-updates + :effects (mutation io) + (fn + (root) + (let + ((signal-els (dom-query-all root "[data-sx-signal]"))) + (for-each + (fn + (el) + (let + ((spec (dom-get-attr el "data-sx-signal"))) + (when + spec + (let + ((colon-idx (index-of spec ":"))) + (when + (> colon-idx 0) + (let + ((store-name (slice spec 0 colon-idx)) + (raw-value (slice spec (+ colon-idx 1)))) + (let + ((parsed (json-parse raw-value))) + (reset! (use-store store-name) parsed)) + (dom-remove-attr el "data-sx-signal"))))))) + signal-els)))) + (define + swap-dom-nodes + :effects (mutation io) + (fn + (target new-nodes (strategy :as string)) + (case + strategy + "innerHTML" + (if + (dom-is-fragment? new-nodes) + (morph-children target new-nodes) + (let + ((wrapper (dom-create-element "div" nil))) + (dom-append wrapper new-nodes) + (morph-children target wrapper))) + "outerHTML" + (let + ((parent (dom-parent target)) + (new-el (dom-clone new-nodes true))) + (if + (dom-is-fragment? new-nodes) + (let + ((fc (dom-first-child new-nodes))) + (if + fc + (do + (set! new-el (dom-clone fc true)) + (dom-replace-child parent new-el target) + (let + ((sib (dom-next-sibling fc))) + (insert-remaining-siblings parent new-el sib))) + (dom-remove-child parent target))) + (dom-replace-child parent new-el target)) + new-el) + "afterend" + (dom-insert-after target new-nodes) + "beforeend" + (dom-append target new-nodes) + "afterbegin" + (dom-prepend target new-nodes) + "beforebegin" + (dom-insert-before (dom-parent target) new-nodes target) + "delete" + (dom-remove-child (dom-parent target) target) + "none" + nil + :else (if + (dom-is-fragment? new-nodes) + (morph-children target new-nodes) + (let + ((wrapper (dom-create-element "div" nil))) + (dom-append wrapper new-nodes) + (morph-children target wrapper)))))) + (define + insert-remaining-siblings + :effects (mutation io) + (fn + (parent ref-node sib) + (when + sib + (let + ((next (dom-next-sibling sib))) + (dom-insert-after ref-node sib) + (insert-remaining-siblings parent sib next))))) + (define + swap-html-string + :effects (mutation io) + (fn + (target (html :as string) (strategy :as string)) + (case + strategy + "innerHTML" + (dom-set-inner-html target html) + "outerHTML" + (let + ((parent (dom-parent target))) + (dom-insert-adjacent-html target "afterend" html) + (dom-remove-child parent target) + parent) + "afterend" + (dom-insert-adjacent-html target "afterend" html) + "beforeend" + (dom-insert-adjacent-html target "beforeend" html) + "afterbegin" + (dom-insert-adjacent-html target "afterbegin" html) + "beforebegin" + (dom-insert-adjacent-html target "beforebegin" html) + "delete" + (dom-remove-child (dom-parent target) target) + "none" + nil + :else (dom-set-inner-html target html)))) + (define + handle-history + :effects (io) + (fn + (el (url :as string) (resp-headers :as dict)) + (let + ((push-url (dom-get-attr el "sx-push-url")) + (replace-url (dom-get-attr el "sx-replace-url")) + (hdr-replace (get resp-headers "replace-url"))) + (cond + hdr-replace + (browser-replace-state hdr-replace) + (and push-url (not (= push-url "false"))) + (do + (save-scroll-position) + (browser-push-state (if (= push-url "true") url push-url))) + (and replace-url (not (= replace-url "false"))) + (browser-replace-state + (if (= replace-url "true") url replace-url)))))) + (define PRELOAD_TTL 30000) + (define + preload-cache-get + :effects (mutation) + (fn + ((cache :as dict) (url :as string)) + (let + ((entry (dict-get cache url))) + (if + (nil? entry) + nil + (if + (> (- (now-ms) (get entry "timestamp")) PRELOAD_TTL) + (do (dict-delete! cache url) nil) + (do (dict-delete! cache url) entry)))))) + (define + preload-cache-set + :effects (mutation) + (fn + ((cache :as dict) + (url :as string) + (text :as string) + (content-type :as string)) + (dict-set! + cache + url + (dict "text" text "content-type" content-type "timestamp" (now-ms))))) + (define + classify-trigger + :effects () + (fn + ((trigger :as dict)) + (let + ((event (get trigger "event"))) + (match + event + ("every" "poll") + ("intersect" "intersect") + ("load" "load") + ("revealed" "revealed") + (_ "event"))))) + (define + should-boost-link? + :effects (io) + (fn + (link) + (let + ((href (dom-get-attr link "href"))) + (and + href + (not (starts-with? href "#")) + (not (starts-with? href "javascript:")) + (not (starts-with? href "mailto:")) + (browser-same-origin? href) + (not (dom-has-attr? link "sx-get")) + (not (dom-has-attr? link "sx-post")) + (not (dom-has-attr? link "sx-disable")))))) + (define + should-boost-form? + :effects (io) + (fn + (form) + (and + (not (dom-has-attr? form "sx-get")) + (not (dom-has-attr? form "sx-post")) + (not (dom-has-attr? form "sx-disable"))))) + (define + parse-sse-swap + :effects (io) + (fn (el) (or (dom-get-attr el "sx-sse-swap") "message"))))) ;; end define-library ;; Re-export to global namespace for backward compatibility (import (web engine)) diff --git a/shared/static/wasm/sx/engine.sxbc b/shared/static/wasm/sx/engine.sxbc index 85a50f4b..f75a5a0b 100644 --- a/shared/static/wasm/sx/engine.sxbc +++ b/shared/static/wasm/sx/engine.sxbc @@ -1,3 +1,3 @@ -(sxbc 1 "857bcca079cfc16b" +(sxbc 1 "a10bcb1db96341ec" (code - :constants ({:library (web boot-helpers) :op "import"} {:library (sx dom) :op "import"} {:library (sx browser) :op "import"} "ENGINE_VERBS" "list" "get" "post" "put" "delete" "patch" "DEFAULT_SWAP" "outerHTML" "parse-time" {:upvalue-count 0 :arity 1 :constants ("nil?" 0 "ends-with?" "ms" "parse-int" "s" "*" "replace" "" 1000) :bytecode (16 0 52 0 0 1 33 6 0 1 1 0 32 74 0 16 0 1 3 0 52 2 0 2 33 12 0 16 0 1 1 0 52 4 0 2 32 50 0 16 0 1 5 0 52 2 0 2 33 29 0 16 0 1 5 0 1 8 0 52 7 0 3 1 1 0 52 4 0 2 1 9 0 52 6 0 2 32 9 0 16 0 1 1 0 52 4 0 2 50)} "parse-trigger-spec" {:upvalue-count 0 :arity 1 :constants ("nil?" "split" "," "filter" {:upvalue-count 0 :arity 1 :constants ("not" "nil?") :bytecode (16 0 52 1 0 1 52 0 0 1 50)} "map" {:upvalue-count 0 :arity 1 :constants ("split" "trim" " " "empty?" "=" "first" "every" ">=" "len" 2 "dict" "event" "modifiers" "interval" "parse-time" "nth" 1 "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "once" "dict-set!" "changed" "starts-with?" "delay:" "delay" "parse-time" "slice" 6 "from:" "from" 5) :bytecode (16 0 1 1 0 52 0 0 2 33 13 0 18 0 1 1 0 3 52 2 0 3 32 97 0 16 0 1 3 0 52 0 0 2 33 13 0 18 0 1 3 0 3 52 2 0 3 32 72 0 16 0 1 5 0 52 4 0 2 33 26 0 18 0 1 6 0 20 7 0 16 0 1 9 0 52 8 0 2 48 1 52 2 0 3 32 34 0 16 0 1 10 0 52 4 0 2 33 21 0 18 0 1 11 0 16 0 1 12 0 52 8 0 2 52 2 0 3 32 1 0 2 50)} "rest" "index-of" "[" 0 "dict-set!" "filter" "slice" "+" "-") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 17 1 16 1 52 3 0 1 33 4 0 2 32 202 0 16 1 52 5 0 1 1 6 0 52 4 0 2 6 33 14 0 5 16 1 52 8 0 1 1 9 0 52 7 0 2 33 37 0 1 11 0 1 6 0 1 12 0 1 13 0 20 14 0 16 1 1 16 0 52 15 0 2 48 1 52 10 0 2 52 10 0 4 32 131 0 52 10 0 0 17 2 51 18 0 1 2 16 1 52 19 0 1 52 17 0 2 5 16 1 52 5 0 1 17 3 16 3 1 21 0 52 20 0 2 17 4 16 4 1 22 0 52 7 0 2 33 64 0 16 2 1 24 0 16 3 16 4 1 16 0 52 26 0 2 16 3 52 8 0 1 1 16 0 52 27 0 2 52 25 0 3 52 23 0 3 5 1 11 0 16 3 1 22 0 16 4 52 25 0 3 1 12 0 16 2 52 10 0 4 32 14 0 1 11 0 16 3 1 12 0 16 2 52 10 0 4 50)}) :bytecode (16 0 52 0 0 1 33 4 0 2 32 27 0 16 0 1 2 0 52 1 0 2 17 1 51 4 0 51 6 0 16 1 52 5 0 2 52 3 0 2 50)} "default-trigger" {:upvalue-count 0 :arity 1 :constants ("=" "form" "list" "dict" "event" "submit" "modifiers" "input" "select" "textarea" "change" "click") :bytecode (16 0 1 1 0 52 0 0 2 33 24 0 1 4 0 1 5 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 32 85 0 16 0 1 7 0 52 0 0 2 6 34 24 0 5 16 0 1 8 0 52 0 0 2 6 34 10 0 5 16 0 1 9 0 52 0 0 2 33 24 0 1 4 0 1 10 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 32 21 0 1 4 0 1 11 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 50)} "get-verb-info" {:upvalue-count 0 :arity 1 :constants ("some" {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "str" "sx-" "dict" "method" "upper" "url") :bytecode (20 0 0 18 0 1 2 0 16 0 52 1 0 2 48 2 17 1 16 1 33 21 0 1 4 0 16 0 52 5 0 1 1 6 0 16 1 52 3 0 4 32 1 0 2 50)} "ENGINE_VERBS") :bytecode (51 1 0 1 0 20 2 0 52 0 0 2 50)} "build-request-headers" {:upvalue-count 0 :arity 2 :constants ("dict" "SX-Request" "true" "SX-Current-URL" "browser-location-href" "dom-get-attr" "sx-target" "dict-set!" "SX-Target" "dom-query" "script[data-components][data-hash]" "data-hash" "SX-Components-Hash" "sx-headers" "parse-header-value" "for-each" {:upvalue-count 2 :arity 1 :constants ("dict-set!" "str" "get") :bytecode (18 0 16 0 18 1 16 0 52 2 0 2 52 1 0 1 52 0 0 3 50)} "keys") :bytecode (1 1 0 1 2 0 1 3 0 20 4 0 48 0 52 0 0 4 17 2 20 5 0 16 0 1 6 0 48 2 17 3 16 3 33 14 0 16 2 1 8 0 16 3 52 7 0 3 32 1 0 2 5 20 5 0 20 9 0 1 10 0 48 1 1 11 0 48 2 17 3 16 3 33 14 0 16 2 1 12 0 16 3 52 7 0 3 32 1 0 2 5 20 5 0 16 0 1 13 0 48 2 17 3 16 3 33 38 0 20 14 0 16 3 48 1 17 4 16 4 33 20 0 51 16 0 1 2 1 4 16 4 52 17 0 1 52 15 0 2 32 1 0 2 32 1 0 2 5 16 2 50)} "process-response-headers" {:upvalue-count 0 :arity 1 :constants ("dict" "redirect" "SX-Redirect" "refresh" "SX-Refresh" "trigger" "SX-Trigger" "retarget" "SX-Retarget" "reswap" "SX-Reswap" "location" "SX-Location" "replace-url" "SX-Replace-Url" "trigger-swap" "SX-Trigger-After-Swap" "trigger-settle" "SX-Trigger-After-Settle" "content-type" "Content-Type" "cache-invalidate" "SX-Cache-Invalidate" "cache-update" "SX-Cache-Update") :bytecode (1 1 0 16 0 1 2 0 48 1 1 3 0 16 0 1 4 0 48 1 1 5 0 16 0 1 6 0 48 1 1 7 0 16 0 1 8 0 48 1 1 9 0 16 0 1 10 0 48 1 1 11 0 16 0 1 12 0 48 1 1 13 0 16 0 1 14 0 48 1 1 15 0 16 0 1 16 0 48 1 1 17 0 16 0 1 18 0 48 1 1 19 0 16 0 1 20 0 48 1 1 21 0 16 0 1 22 0 48 1 1 23 0 16 0 1 24 0 48 1 52 0 0 24 50)} "parse-swap-spec" {:upvalue-count 0 :arity 2 :constants ("split" "DEFAULT_SWAP" " " "first" "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "transition:true" "transition:false") :bytecode (16 0 1 1 0 52 0 0 2 33 6 0 3 19 0 32 19 0 16 0 1 2 0 52 0 0 2 33 6 0 4 19 0 32 1 0 2 50)} "rest" "dict" "style" "transition") :bytecode (16 0 6 34 4 0 5 20 1 0 1 2 0 52 0 0 2 17 2 16 2 52 3 0 1 17 3 16 1 17 4 51 5 0 1 4 16 2 52 6 0 1 52 4 0 2 5 1 8 0 16 3 1 9 0 16 4 52 7 0 4 50)} "parse-retry-spec" {:upvalue-count 0 :arity 1 :constants ("nil?" "split" ":" "dict" "strategy" "first" "start-ms" "parse-int" "nth" 1 1000 "cap-ms" 2 30000) :bytecode (16 0 52 0 0 1 33 4 0 2 32 62 0 16 0 1 2 0 52 1 0 2 17 1 1 4 0 16 1 52 5 0 1 1 6 0 16 1 1 9 0 52 8 0 2 1 10 0 52 7 0 2 1 11 0 16 1 1 12 0 52 8 0 2 1 13 0 52 7 0 2 52 3 0 6 50)} "next-retry-ms" {:upvalue-count 0 :arity 2 :constants ("min" "*" 2) :bytecode (16 0 1 2 0 52 1 0 2 16 1 52 0 0 2 50)} "filter-params" {:upvalue-count 0 :arity 2 :constants ("nil?" "=" "none" "list" "*" "starts-with?" "not " "map" "trim" "split" "slice" 4 "," "filter" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "first") :bytecode (18 0 16 0 52 2 0 1 52 1 0 2 52 0 0 1 50)} {:upvalue-count 1 :arity 1 :constants ("contains?" "first") :bytecode (18 0 16 0 52 1 0 1 52 0 0 2 50)}) :bytecode (16 0 52 0 0 1 33 5 0 16 1 32 116 0 16 0 1 2 0 52 1 0 2 33 7 0 52 3 0 0 32 97 0 16 0 1 4 0 52 1 0 2 33 5 0 16 1 32 80 0 16 0 1 6 0 52 5 0 2 33 39 0 20 8 0 16 0 1 11 0 52 10 0 2 1 12 0 52 9 0 2 52 7 0 2 17 2 51 14 0 1 2 16 1 52 13 0 2 32 29 0 20 8 0 16 0 1 12 0 52 9 0 2 52 7 0 2 17 2 51 15 0 1 2 16 1 52 13 0 2 50)} "resolve-target" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "sx-target" "nil?" "=" "this" "closest" "dom-parent" "dom-query") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 52 2 0 1 6 34 10 0 5 16 1 1 4 0 52 3 0 2 33 5 0 16 0 32 29 0 16 1 1 5 0 52 3 0 2 33 10 0 20 6 0 16 0 49 1 32 7 0 20 7 0 16 1 49 1 50)} "apply-optimistic" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "sx-optimistic" "nil?" "resolve-target" "dict" "target" "directive" "=" "remove" "dict-set!" "opacity" "dom-get-style" "dom-set-style" "0" "pointer-events" "none" "disable" "disabled" "dom-get-prop" "dom-set-prop" "starts-with?" "add-class:" "slice" 10 "add-class" "dom-add-class") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 52 2 0 1 33 4 0 2 32 191 0 20 3 0 16 0 48 1 6 34 3 0 5 16 0 17 2 1 5 0 16 2 1 6 0 16 1 52 4 0 4 17 3 16 1 1 8 0 52 7 0 2 33 50 0 16 3 1 10 0 20 11 0 16 2 1 10 0 48 2 52 9 0 3 5 20 12 0 16 2 1 10 0 1 13 0 48 3 5 20 12 0 16 2 1 14 0 1 15 0 48 3 32 94 0 16 1 1 16 0 52 7 0 2 33 34 0 16 3 1 17 0 20 18 0 16 2 1 17 0 48 2 52 9 0 3 5 20 19 0 16 2 1 17 0 3 48 3 32 48 0 16 1 1 21 0 52 20 0 2 33 35 0 16 1 1 23 0 52 22 0 2 17 4 16 3 1 24 0 16 4 52 9 0 3 5 20 25 0 16 2 16 4 48 2 32 1 0 2 5 16 3 50)} "revert-optimistic" {:upvalue-count 0 :arity 1 :constants ("get" "target" "directive" "=" "remove" "dom-set-style" "opacity" "" "pointer-events" "disable" "dom-set-prop" "disabled" "add-class" "dom-remove-class") :bytecode (16 0 33 153 0 16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 17 2 16 2 1 4 0 52 3 0 2 33 44 0 20 5 0 16 1 1 6 0 16 0 1 6 0 52 0 0 2 6 34 4 0 5 1 7 0 48 3 5 20 5 0 16 1 1 8 0 1 7 0 49 3 32 72 0 16 2 1 9 0 52 3 0 2 33 28 0 20 10 0 16 1 1 11 0 16 0 1 11 0 52 0 0 2 6 34 2 0 5 4 49 3 32 32 0 16 0 1 12 0 52 0 0 2 33 19 0 20 13 0 16 1 16 0 1 12 0 52 0 0 2 49 2 32 1 0 2 32 1 0 2 50)} "find-oob-swaps" {:upvalue-count 0 :arity 1 :constants ("list" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-query-all" "str" "[" "]" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-get-attr" "outerHTML" "dom-id" "dom-remove-attr" "append!" "dict" "element" "swap-type" "target-id") :bytecode (20 0 0 16 0 18 0 48 2 6 34 4 0 5 1 1 0 17 1 20 2 0 16 0 48 1 17 2 20 3 0 16 0 18 0 48 2 5 16 2 33 28 0 18 1 1 6 0 16 0 1 7 0 16 1 1 8 0 16 2 52 5 0 6 52 4 0 2 32 1 0 2 50)}) :bytecode (20 0 0 18 0 1 2 0 16 0 1 3 0 52 1 0 3 48 2 17 1 51 5 0 1 0 0 1 16 1 52 4 0 2 50)} "sx-swap-oob" "hx-swap-oob") :bytecode (52 0 0 0 17 1 51 2 0 1 0 1 1 1 3 0 1 4 0 52 0 0 2 52 1 0 2 5 16 1 50)} "morph-node" {:upvalue-count 0 :arity 2 :constants ("dom-has-attr?" "sx-preserve" "sx-ignore" "data-sx-island" "is-processed?" "island-hydrated" "=" "dom-get-attr" "data-sx-state" "sync-attrs" "not" "dispose-island" "hydrate-island" "morph-island-children" "dom-node-type" "dom-node-name" "dom-replace-child" "dom-parent" "dom-clone" 3 8 "dom-text-content" "dom-set-text-content" 1 "dispose-islands-in" "dom-is-active-element?" "dom-is-input-element?" "morph-children") :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 11 0 5 20 0 0 16 0 1 2 0 48 2 33 4 0 2 32 212 1 20 0 0 16 0 1 3 0 48 2 6 33 55 0 5 20 4 0 16 0 1 5 0 48 2 6 33 40 0 5 20 0 0 16 1 1 3 0 48 2 6 33 25 0 5 20 7 0 16 0 1 3 0 48 2 20 7 0 16 1 1 3 0 48 2 52 6 0 2 33 86 0 20 7 0 16 0 1 8 0 48 2 17 2 20 7 0 16 1 1 8 0 48 2 17 3 20 9 0 16 0 16 1 48 2 5 16 3 6 33 13 0 5 16 2 16 3 52 6 0 2 52 10 0 1 33 18 0 20 11 0 16 0 48 1 5 20 12 0 16 0 49 1 32 9 0 20 13 0 16 0 16 1 49 2 32 54 1 20 14 0 16 0 48 1 20 14 0 16 1 48 1 52 6 0 2 52 10 0 1 6 34 23 0 5 20 15 0 16 0 48 1 20 15 0 16 1 48 1 52 6 0 2 52 10 0 1 33 25 0 20 16 0 20 17 0 16 0 48 1 20 18 0 16 1 3 48 2 16 0 49 3 32 233 0 20 14 0 16 0 48 1 1 19 0 52 6 0 2 6 34 15 0 5 20 14 0 16 0 48 1 1 20 0 52 6 0 2 33 46 0 20 21 0 16 0 48 1 20 21 0 16 1 48 1 52 6 0 2 52 10 0 1 33 17 0 20 22 0 16 0 20 21 0 16 1 48 1 49 2 32 1 0 2 32 151 0 20 14 0 16 0 48 1 1 23 0 52 6 0 2 33 133 0 20 0 0 16 0 1 3 0 48 2 6 33 44 0 5 20 0 0 16 1 1 3 0 48 2 6 33 29 0 5 20 7 0 16 0 1 3 0 48 2 20 7 0 16 1 1 3 0 48 2 52 6 0 2 52 10 0 1 33 18 0 20 11 0 16 0 48 1 5 20 24 0 16 0 48 1 32 1 0 2 5 20 9 0 16 0 16 1 48 2 5 20 25 0 16 0 48 1 6 33 8 0 5 20 26 0 16 0 48 1 52 10 0 1 33 12 0 20 27 0 16 0 16 1 49 2 32 1 0 2 32 1 0 2 50)} "sync-attrs" {:upvalue-count 0 :arity 2 :constants ("dom-get-attr" "data-sx-reactive-attrs" "" "empty?" "list" "split" "," "for-each" {:upvalue-count 2 :arity 1 :constants ("first" "nth" 1 "not" "=" "dom-get-attr" "contains?" "dom-set-attr") :bytecode (16 0 52 0 0 1 17 1 16 0 1 2 0 52 1 0 2 17 2 20 5 0 18 0 16 1 48 2 16 2 52 4 0 2 52 3 0 1 6 33 13 0 5 18 1 16 1 52 6 0 2 52 3 0 1 33 14 0 20 7 0 18 0 16 1 16 2 49 3 32 1 0 2 50)} "dom-attr-list" {:upvalue-count 3 :arity 1 :constants ("first" "not" "dom-has-attr?" "contains?" "=" "data-sx-reactive-attrs" "dom-remove-attr") :bytecode (16 0 52 0 0 1 17 1 20 2 0 18 0 16 1 48 2 52 1 0 1 6 33 31 0 5 18 1 16 1 52 3 0 2 52 1 0 1 6 33 14 0 5 16 1 1 5 0 52 4 0 2 52 1 0 1 33 12 0 20 6 0 18 2 16 1 49 2 32 1 0 2 50)}) :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 17 2 16 2 52 3 0 1 33 7 0 52 4 0 0 32 9 0 16 2 1 6 0 52 5 0 2 17 3 51 8 0 1 0 1 3 20 9 0 16 1 48 1 52 7 0 2 5 51 10 0 1 1 1 3 1 0 20 9 0 16 0 48 1 52 7 0 2 50)} "morph-children" {:upvalue-count 0 :arity 2 :constants ("dom-child-list" "dict" 0 "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-id" "not" "empty?" "dict-set!" "inc") :bytecode (20 0 0 16 0 48 1 17 1 16 1 6 33 11 0 5 16 1 52 2 0 1 52 1 0 1 33 24 0 18 0 16 1 16 0 52 3 0 3 5 18 1 16 1 18 2 52 3 0 3 32 1 0 2 5 18 2 52 4 0 1 19 2 50)} {:upvalue-count 6 :arity 1 :constants ("dom-id" "not" "empty?" "dict-get" "nil?" "dict-set!" "str" "<" "len" "=" "nth" "dom-insert-before" "morph-node" "inc" "dom-clone" "dom-append") :bytecode (20 0 0 16 0 48 1 17 1 16 1 6 33 11 0 5 16 1 52 2 0 1 52 1 0 1 33 5 0 16 1 32 1 0 2 17 2 16 2 33 11 0 18 0 16 2 52 3 0 2 32 1 0 2 17 3 16 3 6 33 11 0 5 16 3 52 4 0 1 52 1 0 1 33 133 0 18 1 16 2 52 3 0 2 17 4 16 4 33 16 0 18 2 16 4 52 6 0 1 3 52 5 0 3 32 1 0 2 5 18 3 18 4 52 8 0 1 52 7 0 2 6 33 19 0 5 16 3 18 4 18 3 52 10 0 2 52 9 0 2 52 1 0 1 33 39 0 20 11 0 18 5 16 3 18 3 18 4 52 8 0 1 52 7 0 2 33 11 0 18 4 18 3 52 10 0 2 32 1 0 2 48 3 32 1 0 2 5 20 12 0 16 3 16 0 48 2 5 18 3 52 13 0 1 19 3 32 135 0 18 3 18 4 52 8 0 1 52 7 0 2 33 105 0 18 4 18 3 52 10 0 2 17 4 20 0 0 16 4 48 1 17 5 16 5 6 33 22 0 5 16 5 52 2 0 1 52 1 0 1 6 33 7 0 5 16 2 52 1 0 1 33 20 0 20 11 0 18 5 20 14 0 16 0 3 48 2 16 4 49 3 32 32 0 18 2 18 3 52 6 0 1 3 52 5 0 3 5 20 12 0 16 4 16 0 48 2 5 18 3 52 13 0 1 19 3 32 15 0 20 15 0 18 5 20 14 0 16 0 3 48 2 49 2 50)} {:upvalue-count 3 :arity 1 :constants ("not" "dict-get" "str" "nth" "dom-is-child-of?" "dom-has-attr?" "sx-preserve" "sx-ignore" "dom-remove-child") :bytecode (18 0 16 0 52 2 0 1 52 1 0 2 52 0 0 1 33 76 0 18 1 16 0 52 3 0 2 17 1 20 4 0 16 1 18 2 48 2 6 33 34 0 5 20 5 0 16 1 1 6 0 48 2 52 0 0 1 6 33 15 0 5 20 5 0 16 1 1 7 0 48 2 52 0 0 1 33 12 0 20 8 0 18 2 16 1 49 2 32 1 0 2 32 1 0 2 50)} "range" "len") :bytecode (20 0 0 16 0 48 1 17 2 20 0 0 16 1 48 1 17 3 52 1 0 0 17 4 52 1 0 0 17 5 52 1 0 0 17 6 1 2 0 17 7 1 2 0 17 8 51 4 0 1 4 1 5 1 8 16 2 52 3 0 2 5 51 5 0 1 4 1 5 1 6 1 7 1 2 1 0 16 3 52 3 0 2 5 51 6 0 1 6 1 2 1 0 1 2 0 16 2 52 8 0 1 52 7 0 2 52 3 0 2 50)} "morph-island-children" {:upvalue-count 0 :arity 2 :constants ("dom-query-all" "[data-sx-lake]" "[data-sx-marsh]" "dict" "for-each" {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "data-sx-lake" "dict-set!") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 13 0 18 0 16 1 16 0 52 2 0 3 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "data-sx-marsh" "dict-set!") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 13 0 18 0 16 1 16 0 52 2 0 3 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "data-sx-lake" "dict-get" "sync-attrs" "morph-children") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 18 0 16 1 52 2 0 2 17 2 16 2 33 22 0 20 3 0 16 0 16 2 48 2 5 20 4 0 16 0 16 2 49 2 32 1 0 2 50)} {:upvalue-count 2 :arity 1 :constants ("dom-get-attr" "data-sx-marsh" "dict-get" "morph-marsh") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 18 0 16 1 52 2 0 2 17 2 16 2 33 14 0 20 3 0 16 0 16 2 18 1 49 3 32 1 0 2 50)} "process-signal-updates") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 20 0 0 16 1 1 1 0 48 2 17 3 20 0 0 16 0 1 2 0 48 2 17 4 20 0 0 16 1 1 2 0 48 2 17 5 52 3 0 0 17 6 52 3 0 0 17 7 51 5 0 1 6 16 3 52 4 0 2 5 51 6 0 1 7 16 5 52 4 0 2 5 51 7 0 1 6 16 2 52 4 0 2 5 51 8 0 1 7 1 0 16 4 52 4 0 2 5 20 9 0 16 1 49 1 50)} "morph-marsh" {:upvalue-count 0 :arity 3 :constants ("dom-get-data" "sx-marsh-transform" "sx-marsh-env" "dom-inner-html" "not" "empty?" "parse" "cek-call" "list" "dispose-marsh-scope" "with-marsh-scope" {:upvalue-count 3 :arity 0 :constants ("render-to-dom" "dom-remove-children-after" "dom-append") :bytecode (20 0 0 18 0 18 1 2 48 3 17 0 20 1 0 18 2 2 48 2 5 20 2 0 18 2 16 0 49 2 50)} "sync-attrs" "morph-children") :bytecode (20 0 0 16 0 1 1 0 48 2 17 3 20 0 0 16 0 1 2 0 48 2 17 4 20 3 0 16 1 48 1 17 5 16 4 6 33 18 0 5 16 5 6 33 11 0 5 16 5 52 5 0 1 52 4 0 1 33 59 0 16 5 52 6 0 1 17 6 16 3 33 15 0 16 3 16 6 52 8 0 1 52 7 0 2 32 2 0 16 6 17 7 20 9 0 16 0 48 1 5 20 10 0 16 0 51 11 0 1 7 1 4 1 0 49 2 32 19 0 20 12 0 16 0 16 1 48 2 5 20 13 0 16 0 16 1 49 2 50)} "process-signal-updates" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "[data-sx-signal]" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "data-sx-signal" "index-of" ":" ">" 0 "slice" "+" 1 "json-parse" "reset!" "use-store" "dom-remove-attr") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 93 0 16 1 1 3 0 52 2 0 2 17 2 16 2 1 5 0 52 4 0 2 33 66 0 16 1 1 5 0 16 2 52 6 0 3 17 3 16 1 16 2 1 8 0 52 7 0 2 52 6 0 2 17 4 20 9 0 16 4 48 1 17 5 20 10 0 16 3 52 11 0 1 16 5 48 2 5 20 12 0 16 0 1 1 0 49 2 32 1 0 2 32 1 0 2 50)}) :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "swap-dom-nodes" {:upvalue-count 0 :arity 3 :constants ("innerHTML" "=" "dom-is-fragment?" "morph-children" "dom-create-element" "div" "dom-append" "outerHTML" "dom-parent" "dom-clone" "dom-first-child" "dom-replace-child" "dom-next-sibling" "insert-remaining-siblings" "dom-remove-child" "afterend" "dom-insert-after" "beforeend" "afterbegin" "dom-prepend" "beforebegin" "dom-insert-before" "delete" "none") :bytecode (16 2 6 1 0 0 52 1 0 2 33 56 0 5 20 2 0 16 1 48 1 33 12 0 20 3 0 16 0 16 1 49 2 32 30 0 20 4 0 1 5 0 2 48 2 17 3 20 6 0 16 3 16 1 48 2 5 20 3 0 16 0 16 3 49 2 32 75 1 6 1 7 0 52 1 0 2 33 119 0 5 20 8 0 16 0 48 1 17 3 20 9 0 16 1 3 48 2 17 4 20 2 0 16 1 48 1 33 72 0 20 10 0 16 1 48 1 17 5 16 5 33 46 0 20 9 0 16 5 3 48 2 17 4 5 20 11 0 16 3 16 4 16 0 48 3 5 20 12 0 16 5 48 1 17 6 20 13 0 16 3 16 4 16 6 48 3 32 9 0 20 14 0 16 3 16 0 48 2 32 11 0 20 11 0 16 3 16 4 16 0 48 3 5 16 4 32 201 0 6 1 15 0 52 1 0 2 33 13 0 5 20 16 0 16 0 16 1 49 2 32 177 0 6 1 17 0 52 1 0 2 33 13 0 5 20 6 0 16 0 16 1 49 2 32 153 0 6 1 18 0 52 1 0 2 33 13 0 5 20 19 0 16 0 16 1 49 2 32 129 0 6 1 20 0 52 1 0 2 33 20 0 5 20 21 0 20 8 0 16 0 48 1 16 1 16 0 49 3 32 98 0 6 1 22 0 52 1 0 2 33 18 0 5 20 14 0 20 8 0 16 0 48 1 16 0 49 2 32 69 0 6 1 23 0 52 1 0 2 33 5 0 5 2 32 53 0 5 20 2 0 16 1 48 1 33 12 0 20 3 0 16 0 16 1 49 2 32 30 0 20 4 0 1 5 0 2 48 2 17 3 20 6 0 16 3 16 1 48 2 5 20 3 0 16 0 16 3 49 2 50)} "insert-remaining-siblings" {:upvalue-count 0 :arity 3 :constants ("dom-next-sibling" "dom-insert-after" "insert-remaining-siblings") :bytecode (16 2 33 33 0 20 0 0 16 2 48 1 17 3 20 1 0 16 1 16 2 48 2 5 20 2 0 16 0 16 2 16 3 49 3 32 1 0 2 50)} "swap-html-string" {:upvalue-count 0 :arity 3 :constants ("innerHTML" "=" "dom-set-inner-html" "outerHTML" "dom-parent" "dom-insert-adjacent-html" "afterend" "dom-remove-child" "beforeend" "afterbegin" "beforebegin" "delete" "none") :bytecode (16 2 6 1 0 0 52 1 0 2 33 13 0 5 20 2 0 16 0 16 1 49 2 32 212 0 6 1 3 0 52 1 0 2 33 38 0 5 20 4 0 16 0 48 1 17 3 20 5 0 16 0 1 6 0 16 1 48 3 5 20 7 0 16 3 16 0 48 2 5 16 3 32 163 0 6 1 6 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 6 0 16 1 49 3 32 136 0 6 1 8 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 8 0 16 1 49 3 32 109 0 6 1 9 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 9 0 16 1 49 3 32 82 0 6 1 10 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 10 0 16 1 49 3 32 55 0 6 1 11 0 52 1 0 2 33 18 0 5 20 7 0 20 4 0 16 0 48 1 16 0 49 2 32 26 0 6 1 12 0 52 1 0 2 33 5 0 5 2 32 10 0 5 20 2 0 16 0 16 1 49 2 50)} "handle-history" {:upvalue-count 0 :arity 3 :constants ("dom-get-attr" "sx-push-url" "sx-replace-url" "get" "replace-url" "browser-replace-state" "not" "=" "false" "save-scroll-position" "browser-push-state" "true") :bytecode (20 0 0 16 0 1 1 0 48 2 17 3 20 0 0 16 0 1 2 0 48 2 17 4 16 2 1 4 0 52 3 0 2 17 5 16 5 33 10 0 20 5 0 16 5 49 1 32 107 0 16 3 6 33 14 0 5 16 3 1 8 0 52 7 0 2 52 6 0 1 33 33 0 20 9 0 48 0 5 20 10 0 16 3 1 11 0 52 7 0 2 33 5 0 16 1 32 2 0 16 3 49 1 32 51 0 16 4 6 33 14 0 5 16 4 1 8 0 52 7 0 2 52 6 0 1 33 27 0 20 5 0 16 4 1 11 0 52 7 0 2 33 5 0 16 1 32 2 0 16 4 49 1 32 1 0 2 50)} "PRELOAD_TTL" 30000 "preload-cache-get" {:upvalue-count 0 :arity 2 :constants ("dict-get" "nil?" ">" "-" "now-ms" "get" "timestamp" "PRELOAD_TTL" "dict-delete!") :bytecode (16 0 16 1 52 0 0 2 17 2 16 2 52 1 0 1 33 4 0 2 32 52 0 20 4 0 48 0 16 2 1 6 0 52 5 0 2 52 3 0 2 20 7 0 52 2 0 2 33 13 0 16 0 16 1 52 8 0 2 5 2 32 11 0 16 0 16 1 52 8 0 2 5 16 2 50)} "preload-cache-set" {:upvalue-count 0 :arity 4 :constants ("dict-set!" "dict" "text" "content-type" "timestamp" "now-ms") :bytecode (16 0 16 1 1 2 0 16 2 1 3 0 16 3 1 4 0 20 5 0 48 0 52 1 0 6 52 0 0 3 50)} "classify-trigger" {:upvalue-count 0 :arity 1 :constants ("get" "event" "=" "every" "poll" "intersect" "load" "revealed") :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 1 1 3 0 52 2 0 2 33 6 0 1 4 0 32 57 0 16 1 1 5 0 52 2 0 2 33 6 0 1 5 0 32 39 0 16 1 1 6 0 52 2 0 2 33 6 0 1 6 0 32 21 0 16 1 1 7 0 52 2 0 2 33 6 0 1 7 0 32 3 0 1 1 0 50)} "should-boost-link?" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "href" "not" "starts-with?" "#" "javascript:" "mailto:" "browser-same-origin?" "dom-has-attr?" "sx-get" "sx-post" "sx-disable") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 33 119 0 5 16 1 1 4 0 52 3 0 2 52 2 0 1 6 33 101 0 5 16 1 1 5 0 52 3 0 2 52 2 0 1 6 33 83 0 5 16 1 1 6 0 52 3 0 2 52 2 0 1 6 33 65 0 5 20 7 0 16 1 48 1 6 33 53 0 5 20 8 0 16 0 1 9 0 48 2 52 2 0 1 6 33 34 0 5 20 8 0 16 0 1 10 0 48 2 52 2 0 1 6 33 15 0 5 20 8 0 16 0 1 11 0 48 2 52 2 0 1 50)} "should-boost-form?" {:upvalue-count 0 :arity 1 :constants ("not" "dom-has-attr?" "sx-get" "sx-post" "sx-disable") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 6 33 34 0 5 20 1 0 16 0 1 3 0 48 2 52 0 0 1 6 33 15 0 5 20 1 0 16 0 1 4 0 48 2 52 0 0 1 50)} "parse-sse-swap" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "sx-sse-swap" "message") :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 50)} {:library (web engine) :op "import"}) :bytecode (1 0 0 112 5 1 1 0 112 5 1 2 0 112 5 1 5 0 1 6 0 1 7 0 1 8 0 1 9 0 52 4 0 5 128 3 0 5 1 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 41 0 128 40 0 5 51 43 0 128 42 0 5 51 45 0 128 44 0 5 51 47 0 128 46 0 5 51 49 0 128 48 0 5 51 51 0 128 50 0 5 51 53 0 128 52 0 5 51 55 0 128 54 0 5 51 57 0 128 56 0 5 51 59 0 128 58 0 5 1 61 0 128 60 0 5 51 63 0 128 62 0 5 51 65 0 128 64 0 5 51 67 0 128 66 0 5 51 69 0 128 68 0 5 51 71 0 128 70 0 5 51 73 0 128 72 0 5 1 74 0 112 50))) + :constants ({:library (web boot-helpers) :op "import"} {:library (sx dom) :op "import"} {:library (sx browser) :op "import"} "ENGINE_VERBS" "list" "get" "post" "put" "delete" "patch" "DEFAULT_SWAP" "outerHTML" "parse-time" {:upvalue-count 0 :arity 1 :constants ("nil?" 0 "ends-with?" "ms" "parse-int" "s" "*" "replace" "" 1000) :bytecode (16 0 52 0 0 1 33 6 0 1 1 0 32 74 0 16 0 1 3 0 52 2 0 2 33 12 0 16 0 1 1 0 52 4 0 2 32 50 0 16 0 1 5 0 52 2 0 2 33 29 0 16 0 1 5 0 1 8 0 52 7 0 3 1 1 0 52 4 0 2 1 9 0 52 6 0 2 32 9 0 16 0 1 1 0 52 4 0 2 50)} "parse-trigger-spec" {:upvalue-count 0 :arity 1 :constants ("nil?" "split" "," "filter" {:upvalue-count 0 :arity 1 :constants ("not" "nil?") :bytecode (16 0 52 1 0 1 52 0 0 1 50)} "map" {:upvalue-count 0 :arity 1 :constants ("split" "trim" " " "empty?" "=" "first" "every" ">=" "len" 2 "dict" "event" "modifiers" "interval" "parse-time" "nth" 1 "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "once" "dict-set!" "changed" "starts-with?" "delay:" "delay" "parse-time" "slice" 6 "from:" "from" 5) :bytecode (16 0 1 1 0 52 0 0 2 33 13 0 18 0 1 1 0 3 52 2 0 3 32 97 0 16 0 1 3 0 52 0 0 2 33 13 0 18 0 1 3 0 3 52 2 0 3 32 72 0 16 0 1 5 0 52 4 0 2 33 26 0 18 0 1 6 0 20 7 0 16 0 1 9 0 52 8 0 2 48 1 52 2 0 3 32 34 0 16 0 1 10 0 52 4 0 2 33 21 0 18 0 1 11 0 16 0 1 12 0 52 8 0 2 52 2 0 3 32 1 0 2 50)} "rest" "index-of" "[" 0 "dict-set!" "filter" "slice" "+" "-") :bytecode (16 0 52 1 0 1 1 2 0 52 0 0 2 17 1 16 1 52 3 0 1 33 4 0 2 32 202 0 16 1 52 5 0 1 1 6 0 52 4 0 2 6 33 14 0 5 16 1 52 8 0 1 1 9 0 52 7 0 2 33 37 0 1 11 0 1 6 0 1 12 0 1 13 0 20 14 0 16 1 1 16 0 52 15 0 2 48 1 52 10 0 2 52 10 0 4 32 131 0 52 10 0 0 17 2 51 18 0 1 2 16 1 52 19 0 1 52 17 0 2 5 16 1 52 5 0 1 17 3 16 3 1 21 0 52 20 0 2 17 4 16 4 1 22 0 52 7 0 2 33 64 0 16 2 1 24 0 16 3 16 4 1 16 0 52 26 0 2 16 3 52 8 0 1 1 16 0 52 27 0 2 52 25 0 3 52 23 0 3 5 1 11 0 16 3 1 22 0 16 4 52 25 0 3 1 12 0 16 2 52 10 0 4 32 14 0 1 11 0 16 3 1 12 0 16 2 52 10 0 4 50)}) :bytecode (16 0 52 0 0 1 33 4 0 2 32 27 0 16 0 1 2 0 52 1 0 2 17 1 51 4 0 51 6 0 16 1 52 5 0 2 52 3 0 2 50)} "default-trigger" {:upvalue-count 0 :arity 1 :constants ("form" "=" "list" "dict" "event" "submit" "modifiers" "input" "change" "select" "textarea" "click") :bytecode (16 0 6 1 0 0 52 1 0 2 33 25 0 5 1 4 0 1 5 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 32 130 0 6 1 7 0 52 1 0 2 33 25 0 5 1 4 0 1 8 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 32 94 0 6 1 9 0 52 1 0 2 33 25 0 5 1 4 0 1 8 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 32 58 0 6 1 10 0 52 1 0 2 33 25 0 5 1 4 0 1 8 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 32 22 0 5 1 4 0 1 11 0 1 6 0 52 3 0 0 52 3 0 4 52 2 0 1 50)} "get-verb-info" {:upvalue-count 0 :arity 1 :constants ("some" {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "str" "sx-" "dict" "method" "upper" "url") :bytecode (20 0 0 18 0 1 2 0 16 0 52 1 0 2 48 2 17 1 16 1 33 21 0 1 4 0 16 0 52 5 0 1 1 6 0 16 1 52 3 0 4 32 1 0 2 50)} "ENGINE_VERBS") :bytecode (51 1 0 1 0 20 2 0 52 0 0 2 50)} "build-request-headers" {:upvalue-count 0 :arity 2 :constants ("dict" "SX-Request" "true" "SX-Current-URL" "browser-location-href" "dom-get-attr" "sx-target" "dict-set!" "SX-Target" "dom-query" "script[data-components][data-hash]" "data-hash" "SX-Components-Hash" "sx-headers" "parse-header-value" "for-each" {:upvalue-count 2 :arity 1 :constants ("dict-set!" "str" "get") :bytecode (18 0 16 0 18 1 16 0 52 2 0 2 52 1 0 1 52 0 0 3 50)} "keys") :bytecode (1 1 0 1 2 0 1 3 0 20 4 0 48 0 52 0 0 4 17 2 20 5 0 16 0 1 6 0 48 2 17 3 16 3 33 14 0 16 2 1 8 0 16 3 52 7 0 3 32 1 0 2 5 20 5 0 20 9 0 1 10 0 48 1 1 11 0 48 2 17 3 16 3 33 14 0 16 2 1 12 0 16 3 52 7 0 3 32 1 0 2 5 20 5 0 16 0 1 13 0 48 2 17 3 16 3 33 38 0 20 14 0 16 3 48 1 17 4 16 4 33 20 0 51 16 0 1 2 1 4 16 4 52 17 0 1 52 15 0 2 32 1 0 2 32 1 0 2 5 16 2 50)} "process-response-headers" {:upvalue-count 0 :arity 1 :constants ("dict" "redirect" "SX-Redirect" "refresh" "SX-Refresh" "trigger" "SX-Trigger" "retarget" "SX-Retarget" "reswap" "SX-Reswap" "location" "SX-Location" "replace-url" "SX-Replace-Url" "trigger-swap" "SX-Trigger-After-Swap" "trigger-settle" "SX-Trigger-After-Settle" "content-type" "Content-Type" "cache-invalidate" "SX-Cache-Invalidate" "cache-update" "SX-Cache-Update") :bytecode (1 1 0 16 0 1 2 0 48 1 1 3 0 16 0 1 4 0 48 1 1 5 0 16 0 1 6 0 48 1 1 7 0 16 0 1 8 0 48 1 1 9 0 16 0 1 10 0 48 1 1 11 0 16 0 1 12 0 48 1 1 13 0 16 0 1 14 0 48 1 1 15 0 16 0 1 16 0 48 1 1 17 0 16 0 1 18 0 48 1 1 19 0 16 0 1 20 0 48 1 1 21 0 16 0 1 22 0 48 1 1 23 0 16 0 1 24 0 48 1 52 0 0 24 50)} "parse-swap-spec" {:upvalue-count 0 :arity 2 :constants ("split" "DEFAULT_SWAP" " " "first" "for-each" {:upvalue-count 1 :arity 1 :constants ("=" "transition:true" "transition:false") :bytecode (16 0 1 1 0 52 0 0 2 33 6 0 3 19 0 32 19 0 16 0 1 2 0 52 0 0 2 33 6 0 4 19 0 32 1 0 2 50)} "rest" "dict" "style" "transition") :bytecode (16 0 6 34 4 0 5 20 1 0 1 2 0 52 0 0 2 17 2 16 2 52 3 0 1 17 3 16 1 17 4 51 5 0 1 4 16 2 52 6 0 1 52 4 0 2 5 1 8 0 16 3 1 9 0 16 4 52 7 0 4 50)} "parse-retry-spec" {:upvalue-count 0 :arity 1 :constants ("nil?" "split" ":" "dict" "strategy" "first" "start-ms" "parse-int" "nth" 1 1000 "cap-ms" 2 30000) :bytecode (16 0 52 0 0 1 33 4 0 2 32 62 0 16 0 1 2 0 52 1 0 2 17 1 1 4 0 16 1 52 5 0 1 1 6 0 16 1 1 9 0 52 8 0 2 1 10 0 52 7 0 2 1 11 0 16 1 1 12 0 52 8 0 2 1 13 0 52 7 0 2 52 3 0 6 50)} "next-retry-ms" {:upvalue-count 0 :arity 2 :constants ("min" "*" 2) :bytecode (16 0 1 2 0 52 1 0 2 16 1 52 0 0 2 50)} "filter-params" {:upvalue-count 0 :arity 2 :constants ("nil?" "=" "none" "list" "*" "starts-with?" "not " "map" "trim" "split" "slice" 4 "," "filter" {:upvalue-count 1 :arity 1 :constants ("not" "contains?" "first") :bytecode (18 0 16 0 52 2 0 1 52 1 0 2 52 0 0 1 50)} {:upvalue-count 1 :arity 1 :constants ("contains?" "first") :bytecode (18 0 16 0 52 1 0 1 52 0 0 2 50)}) :bytecode (16 0 52 0 0 1 33 5 0 16 1 32 116 0 16 0 1 2 0 52 1 0 2 33 7 0 52 3 0 0 32 97 0 16 0 1 4 0 52 1 0 2 33 5 0 16 1 32 80 0 16 0 1 6 0 52 5 0 2 33 39 0 20 8 0 16 0 1 11 0 52 10 0 2 1 12 0 52 9 0 2 52 7 0 2 17 2 51 14 0 1 2 16 1 52 13 0 2 32 29 0 20 8 0 16 0 1 12 0 52 9 0 2 52 7 0 2 17 2 51 15 0 1 2 16 1 52 13 0 2 50)} "resolve-target" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "sx-target" "=" "this" "closest" "dom-parent" "dom-query") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 2 52 2 0 2 33 6 0 5 16 0 32 47 0 6 1 3 0 52 2 0 2 33 6 0 5 16 0 32 30 0 6 1 4 0 52 2 0 2 33 11 0 5 20 5 0 16 0 49 1 32 8 0 5 20 6 0 16 1 49 1 50)} "apply-optimistic" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "sx-optimistic" "nil?" "resolve-target" "dict" "target" "directive" "=" "remove" "dict-set!" "opacity" "dom-get-style" "dom-set-style" "0" "pointer-events" "none" "disable" "disabled" "dom-get-prop" "dom-set-prop" "starts-with?" "add-class:" "slice" 10 "add-class" "dom-add-class") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 52 2 0 1 33 4 0 2 32 191 0 20 3 0 16 0 48 1 6 34 3 0 5 16 0 17 2 1 5 0 16 2 1 6 0 16 1 52 4 0 4 17 3 16 1 1 8 0 52 7 0 2 33 50 0 16 3 1 10 0 20 11 0 16 2 1 10 0 48 2 52 9 0 3 5 20 12 0 16 2 1 10 0 1 13 0 48 3 5 20 12 0 16 2 1 14 0 1 15 0 48 3 32 94 0 16 1 1 16 0 52 7 0 2 33 34 0 16 3 1 17 0 20 18 0 16 2 1 17 0 48 2 52 9 0 3 5 20 19 0 16 2 1 17 0 3 48 3 32 48 0 16 1 1 21 0 52 20 0 2 33 35 0 16 1 1 23 0 52 22 0 2 17 4 16 3 1 24 0 16 4 52 9 0 3 5 20 25 0 16 2 16 4 48 2 32 1 0 2 5 16 3 50)} "revert-optimistic" {:upvalue-count 0 :arity 1 :constants ("get" "target" "directive" "=" "remove" "dom-set-style" "opacity" "" "pointer-events" "disable" "dom-set-prop" "disabled" "add-class" "dom-remove-class") :bytecode (16 0 33 153 0 16 0 1 1 0 52 0 0 2 17 1 16 0 1 2 0 52 0 0 2 17 2 16 2 1 4 0 52 3 0 2 33 44 0 20 5 0 16 1 1 6 0 16 0 1 6 0 52 0 0 2 6 34 4 0 5 1 7 0 48 3 5 20 5 0 16 1 1 8 0 1 7 0 49 3 32 72 0 16 2 1 9 0 52 3 0 2 33 28 0 20 10 0 16 1 1 11 0 16 0 1 11 0 52 0 0 2 6 34 2 0 5 4 49 3 32 32 0 16 0 1 12 0 52 0 0 2 33 19 0 20 13 0 16 1 16 0 1 12 0 52 0 0 2 49 2 32 1 0 2 32 1 0 2 50)} "find-oob-swaps" {:upvalue-count 0 :arity 1 :constants ("list" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-query-all" "str" "[" "]" "for-each" {:upvalue-count 2 :arity 1 :constants ("dom-get-attr" "outerHTML" "dom-id" "dom-remove-attr" "append!" "dict" "element" "swap-type" "target-id") :bytecode (20 0 0 16 0 18 0 48 2 6 34 4 0 5 1 1 0 17 1 20 2 0 16 0 48 1 17 2 20 3 0 16 0 18 0 48 2 5 16 2 33 28 0 18 1 1 6 0 16 0 1 7 0 16 1 1 8 0 16 2 52 5 0 6 52 4 0 2 32 1 0 2 50)}) :bytecode (20 0 0 18 0 1 2 0 16 0 1 3 0 52 1 0 3 48 2 17 1 51 5 0 1 0 0 1 16 1 52 4 0 2 50)} "sx-swap-oob" "hx-swap-oob") :bytecode (52 0 0 0 17 1 51 2 0 1 0 1 1 1 3 0 1 4 0 52 0 0 2 52 1 0 2 5 16 1 50)} "morph-node" {:upvalue-count 0 :arity 2 :constants ("dom-has-attr?" "sx-preserve" "sx-ignore" "data-sx-island" "is-processed?" "island-hydrated" "=" "dom-get-attr" "data-sx-state" "sync-attrs" "not" "dispose-island" "hydrate-island" "morph-island-children" "dom-node-type" "dom-node-name" "dom-replace-child" "dom-parent" "dom-clone" 3 8 "dom-text-content" "dom-set-text-content" 1 "dispose-islands-in" "dom-is-active-element?" "dom-is-input-element?" "morph-children") :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 11 0 5 20 0 0 16 0 1 2 0 48 2 33 4 0 2 32 212 1 20 0 0 16 0 1 3 0 48 2 6 33 55 0 5 20 4 0 16 0 1 5 0 48 2 6 33 40 0 5 20 0 0 16 1 1 3 0 48 2 6 33 25 0 5 20 7 0 16 0 1 3 0 48 2 20 7 0 16 1 1 3 0 48 2 52 6 0 2 33 86 0 20 7 0 16 0 1 8 0 48 2 17 2 20 7 0 16 1 1 8 0 48 2 17 3 20 9 0 16 0 16 1 48 2 5 16 3 6 33 13 0 5 16 2 16 3 52 6 0 2 52 10 0 1 33 18 0 20 11 0 16 0 48 1 5 20 12 0 16 0 49 1 32 9 0 20 13 0 16 0 16 1 49 2 32 54 1 20 14 0 16 0 48 1 20 14 0 16 1 48 1 52 6 0 2 52 10 0 1 6 34 23 0 5 20 15 0 16 0 48 1 20 15 0 16 1 48 1 52 6 0 2 52 10 0 1 33 25 0 20 16 0 20 17 0 16 0 48 1 20 18 0 16 1 3 48 2 16 0 49 3 32 233 0 20 14 0 16 0 48 1 1 19 0 52 6 0 2 6 34 15 0 5 20 14 0 16 0 48 1 1 20 0 52 6 0 2 33 46 0 20 21 0 16 0 48 1 20 21 0 16 1 48 1 52 6 0 2 52 10 0 1 33 17 0 20 22 0 16 0 20 21 0 16 1 48 1 49 2 32 1 0 2 32 151 0 20 14 0 16 0 48 1 1 23 0 52 6 0 2 33 133 0 20 0 0 16 0 1 3 0 48 2 6 33 44 0 5 20 0 0 16 1 1 3 0 48 2 6 33 29 0 5 20 7 0 16 0 1 3 0 48 2 20 7 0 16 1 1 3 0 48 2 52 6 0 2 52 10 0 1 33 18 0 20 11 0 16 0 48 1 5 20 24 0 16 0 48 1 32 1 0 2 5 20 9 0 16 0 16 1 48 2 5 20 25 0 16 0 48 1 6 33 8 0 5 20 26 0 16 0 48 1 52 10 0 1 33 12 0 20 27 0 16 0 16 1 49 2 32 1 0 2 32 1 0 2 50)} "sync-attrs" {:upvalue-count 0 :arity 2 :constants ("dom-get-attr" "data-sx-reactive-attrs" "" "empty?" "list" "split" "," "for-each" {:upvalue-count 2 :arity 1 :constants ("first" "nth" 1 "not" "=" "dom-get-attr" "contains?" "dom-set-attr") :bytecode (16 0 52 0 0 1 17 1 16 0 1 2 0 52 1 0 2 17 2 20 5 0 18 0 16 1 48 2 16 2 52 4 0 2 52 3 0 1 6 33 13 0 5 18 1 16 1 52 6 0 2 52 3 0 1 33 14 0 20 7 0 18 0 16 1 16 2 49 3 32 1 0 2 50)} "dom-attr-list" {:upvalue-count 3 :arity 1 :constants ("first" "not" "dom-has-attr?" "contains?" "=" "data-sx-reactive-attrs" "dom-remove-attr") :bytecode (16 0 52 0 0 1 17 1 20 2 0 18 0 16 1 48 2 52 1 0 1 6 33 31 0 5 18 1 16 1 52 3 0 2 52 1 0 1 6 33 14 0 5 16 1 1 5 0 52 4 0 2 52 1 0 1 33 12 0 20 6 0 18 2 16 1 49 2 32 1 0 2 50)}) :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 17 2 16 2 52 3 0 1 33 7 0 52 4 0 0 32 9 0 16 2 1 6 0 52 5 0 2 17 3 51 8 0 1 0 1 3 20 9 0 16 1 48 1 52 7 0 2 5 51 10 0 1 1 1 3 1 0 20 9 0 16 0 48 1 52 7 0 2 50)} "morph-children" {:upvalue-count 0 :arity 2 :constants ("dom-child-list" "dict" 0 "for-each" {:upvalue-count 3 :arity 1 :constants ("dom-id" "not" "empty?" "dict-set!" "inc") :bytecode (20 0 0 16 0 48 1 17 1 16 1 6 33 11 0 5 16 1 52 2 0 1 52 1 0 1 33 24 0 18 0 16 1 16 0 52 3 0 3 5 18 1 16 1 18 2 52 3 0 3 32 1 0 2 5 18 2 52 4 0 1 19 2 50)} {:upvalue-count 6 :arity 1 :constants ("dom-id" "not" "empty?" "dict-get" "nil?" "dict-set!" "str" "<" "len" "=" "nth" "dom-insert-before" "morph-node" "inc" "dom-clone" "dom-append") :bytecode (20 0 0 16 0 48 1 17 1 16 1 6 33 11 0 5 16 1 52 2 0 1 52 1 0 1 33 5 0 16 1 32 1 0 2 17 2 16 2 33 11 0 18 0 16 2 52 3 0 2 32 1 0 2 17 3 16 3 6 33 11 0 5 16 3 52 4 0 1 52 1 0 1 33 133 0 18 1 16 2 52 3 0 2 17 4 16 4 33 16 0 18 2 16 4 52 6 0 1 3 52 5 0 3 32 1 0 2 5 18 3 18 4 52 8 0 1 52 7 0 2 6 33 19 0 5 16 3 18 4 18 3 52 10 0 2 52 9 0 2 52 1 0 1 33 39 0 20 11 0 18 5 16 3 18 3 18 4 52 8 0 1 52 7 0 2 33 11 0 18 4 18 3 52 10 0 2 32 1 0 2 48 3 32 1 0 2 5 20 12 0 16 3 16 0 48 2 5 18 3 52 13 0 1 19 3 32 135 0 18 3 18 4 52 8 0 1 52 7 0 2 33 105 0 18 4 18 3 52 10 0 2 17 4 20 0 0 16 4 48 1 17 5 16 5 6 33 22 0 5 16 5 52 2 0 1 52 1 0 1 6 33 7 0 5 16 2 52 1 0 1 33 20 0 20 11 0 18 5 20 14 0 16 0 3 48 2 16 4 49 3 32 32 0 18 2 18 3 52 6 0 1 3 52 5 0 3 5 20 12 0 16 4 16 0 48 2 5 18 3 52 13 0 1 19 3 32 15 0 20 15 0 18 5 20 14 0 16 0 3 48 2 49 2 50)} {:upvalue-count 3 :arity 1 :constants ("not" "dict-get" "str" "nth" "dom-is-child-of?" "dom-has-attr?" "sx-preserve" "sx-ignore" "dom-remove-child") :bytecode (18 0 16 0 52 2 0 1 52 1 0 2 52 0 0 1 33 76 0 18 1 16 0 52 3 0 2 17 1 20 4 0 16 1 18 2 48 2 6 33 34 0 5 20 5 0 16 1 1 6 0 48 2 52 0 0 1 6 33 15 0 5 20 5 0 16 1 1 7 0 48 2 52 0 0 1 33 12 0 20 8 0 18 2 16 1 49 2 32 1 0 2 32 1 0 2 50)} "range" "len") :bytecode (20 0 0 16 0 48 1 17 2 20 0 0 16 1 48 1 17 3 52 1 0 0 17 4 52 1 0 0 17 5 52 1 0 0 17 6 1 2 0 17 7 1 2 0 17 8 51 4 0 1 4 1 5 1 8 16 2 52 3 0 2 5 51 5 0 1 4 1 5 1 6 1 7 1 2 1 0 16 3 52 3 0 2 5 51 6 0 1 6 1 2 1 0 1 2 0 16 2 52 8 0 1 52 7 0 2 52 3 0 2 50)} "morph-island-children" {:upvalue-count 0 :arity 2 :constants ("dom-query-all" "[data-sx-lake]" "[data-sx-marsh]" "dict" "for-each" {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "data-sx-lake" "dict-set!") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 13 0 18 0 16 1 16 0 52 2 0 3 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "data-sx-marsh" "dict-set!") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 13 0 18 0 16 1 16 0 52 2 0 3 32 1 0 2 50)} {:upvalue-count 1 :arity 1 :constants ("dom-get-attr" "data-sx-lake" "dict-get" "sync-attrs" "morph-children") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 18 0 16 1 52 2 0 2 17 2 16 2 33 22 0 20 3 0 16 0 16 2 48 2 5 20 4 0 16 0 16 2 49 2 32 1 0 2 50)} {:upvalue-count 2 :arity 1 :constants ("dom-get-attr" "data-sx-marsh" "dict-get" "morph-marsh") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 18 0 16 1 52 2 0 2 17 2 16 2 33 14 0 20 3 0 16 0 16 2 18 1 49 3 32 1 0 2 50)} "process-signal-updates") :bytecode (20 0 0 16 0 1 1 0 48 2 17 2 20 0 0 16 1 1 1 0 48 2 17 3 20 0 0 16 0 1 2 0 48 2 17 4 20 0 0 16 1 1 2 0 48 2 17 5 52 3 0 0 17 6 52 3 0 0 17 7 51 5 0 1 6 16 3 52 4 0 2 5 51 6 0 1 7 16 5 52 4 0 2 5 51 7 0 1 6 16 2 52 4 0 2 5 51 8 0 1 7 1 0 16 4 52 4 0 2 5 20 9 0 16 1 49 1 50)} "morph-marsh" {:upvalue-count 0 :arity 3 :constants ("dom-get-data" "sx-marsh-transform" "sx-marsh-env" "dom-inner-html" "not" "empty?" "parse" "cek-call" "list" "dispose-marsh-scope" "with-marsh-scope" {:upvalue-count 3 :arity 0 :constants ("render-to-dom" "dom-remove-children-after" "dom-append") :bytecode (20 0 0 18 0 18 1 2 48 3 17 0 20 1 0 18 2 2 48 2 5 20 2 0 18 2 16 0 49 2 50)} "sync-attrs" "morph-children") :bytecode (20 0 0 16 0 1 1 0 48 2 17 3 20 0 0 16 0 1 2 0 48 2 17 4 20 3 0 16 1 48 1 17 5 16 4 6 33 18 0 5 16 5 6 33 11 0 5 16 5 52 5 0 1 52 4 0 1 33 59 0 16 5 52 6 0 1 17 6 16 3 33 15 0 16 3 16 6 52 8 0 1 52 7 0 2 32 2 0 16 6 17 7 20 9 0 16 0 48 1 5 20 10 0 16 0 51 11 0 1 7 1 4 1 0 49 2 32 19 0 20 12 0 16 0 16 1 48 2 5 20 13 0 16 0 16 1 49 2 50)} "process-signal-updates" {:upvalue-count 0 :arity 1 :constants ("dom-query-all" "[data-sx-signal]" "for-each" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "data-sx-signal" "index-of" ":" ">" 0 "slice" "+" 1 "json-parse" "reset!" "use-store" "dom-remove-attr") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 33 93 0 16 1 1 3 0 52 2 0 2 17 2 16 2 1 5 0 52 4 0 2 33 66 0 16 1 1 5 0 16 2 52 6 0 3 17 3 16 1 16 2 1 8 0 52 7 0 2 52 6 0 2 17 4 20 9 0 16 4 48 1 17 5 20 10 0 16 3 52 11 0 1 16 5 48 2 5 20 12 0 16 0 1 1 0 49 2 32 1 0 2 32 1 0 2 50)}) :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 51 3 0 16 1 52 2 0 2 50)} "swap-dom-nodes" {:upvalue-count 0 :arity 3 :constants ("innerHTML" "=" "dom-is-fragment?" "morph-children" "dom-create-element" "div" "dom-append" "outerHTML" "dom-parent" "dom-clone" "dom-first-child" "dom-replace-child" "dom-next-sibling" "insert-remaining-siblings" "dom-remove-child" "afterend" "dom-insert-after" "beforeend" "afterbegin" "dom-prepend" "beforebegin" "dom-insert-before" "delete" "none") :bytecode (16 2 6 1 0 0 52 1 0 2 33 56 0 5 20 2 0 16 1 48 1 33 12 0 20 3 0 16 0 16 1 49 2 32 30 0 20 4 0 1 5 0 2 48 2 17 3 20 6 0 16 3 16 1 48 2 5 20 3 0 16 0 16 3 49 2 32 75 1 6 1 7 0 52 1 0 2 33 119 0 5 20 8 0 16 0 48 1 17 3 20 9 0 16 1 3 48 2 17 4 20 2 0 16 1 48 1 33 72 0 20 10 0 16 1 48 1 17 5 16 5 33 46 0 20 9 0 16 5 3 48 2 17 4 5 20 11 0 16 3 16 4 16 0 48 3 5 20 12 0 16 5 48 1 17 6 20 13 0 16 3 16 4 16 6 48 3 32 9 0 20 14 0 16 3 16 0 48 2 32 11 0 20 11 0 16 3 16 4 16 0 48 3 5 16 4 32 201 0 6 1 15 0 52 1 0 2 33 13 0 5 20 16 0 16 0 16 1 49 2 32 177 0 6 1 17 0 52 1 0 2 33 13 0 5 20 6 0 16 0 16 1 49 2 32 153 0 6 1 18 0 52 1 0 2 33 13 0 5 20 19 0 16 0 16 1 49 2 32 129 0 6 1 20 0 52 1 0 2 33 20 0 5 20 21 0 20 8 0 16 0 48 1 16 1 16 0 49 3 32 98 0 6 1 22 0 52 1 0 2 33 18 0 5 20 14 0 20 8 0 16 0 48 1 16 0 49 2 32 69 0 6 1 23 0 52 1 0 2 33 5 0 5 2 32 53 0 5 20 2 0 16 1 48 1 33 12 0 20 3 0 16 0 16 1 49 2 32 30 0 20 4 0 1 5 0 2 48 2 17 3 20 6 0 16 3 16 1 48 2 5 20 3 0 16 0 16 3 49 2 50)} "insert-remaining-siblings" {:upvalue-count 0 :arity 3 :constants ("dom-next-sibling" "dom-insert-after" "insert-remaining-siblings") :bytecode (16 2 33 33 0 20 0 0 16 2 48 1 17 3 20 1 0 16 1 16 2 48 2 5 20 2 0 16 0 16 2 16 3 49 3 32 1 0 2 50)} "swap-html-string" {:upvalue-count 0 :arity 3 :constants ("innerHTML" "=" "dom-set-inner-html" "outerHTML" "dom-parent" "dom-insert-adjacent-html" "afterend" "dom-remove-child" "beforeend" "afterbegin" "beforebegin" "delete" "none") :bytecode (16 2 6 1 0 0 52 1 0 2 33 13 0 5 20 2 0 16 0 16 1 49 2 32 212 0 6 1 3 0 52 1 0 2 33 38 0 5 20 4 0 16 0 48 1 17 3 20 5 0 16 0 1 6 0 16 1 48 3 5 20 7 0 16 3 16 0 48 2 5 16 3 32 163 0 6 1 6 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 6 0 16 1 49 3 32 136 0 6 1 8 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 8 0 16 1 49 3 32 109 0 6 1 9 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 9 0 16 1 49 3 32 82 0 6 1 10 0 52 1 0 2 33 16 0 5 20 5 0 16 0 1 10 0 16 1 49 3 32 55 0 6 1 11 0 52 1 0 2 33 18 0 5 20 7 0 20 4 0 16 0 48 1 16 0 49 2 32 26 0 6 1 12 0 52 1 0 2 33 5 0 5 2 32 10 0 5 20 2 0 16 0 16 1 49 2 50)} "handle-history" {:upvalue-count 0 :arity 3 :constants ("dom-get-attr" "sx-push-url" "sx-replace-url" "get" "replace-url" "browser-replace-state" "not" "=" "false" "save-scroll-position" "browser-push-state" "true") :bytecode (20 0 0 16 0 1 1 0 48 2 17 3 20 0 0 16 0 1 2 0 48 2 17 4 16 2 1 4 0 52 3 0 2 17 5 16 5 33 10 0 20 5 0 16 5 49 1 32 107 0 16 3 6 33 14 0 5 16 3 1 8 0 52 7 0 2 52 6 0 1 33 33 0 20 9 0 48 0 5 20 10 0 16 3 1 11 0 52 7 0 2 33 5 0 16 1 32 2 0 16 3 49 1 32 51 0 16 4 6 33 14 0 5 16 4 1 8 0 52 7 0 2 52 6 0 1 33 27 0 20 5 0 16 4 1 11 0 52 7 0 2 33 5 0 16 1 32 2 0 16 4 49 1 32 1 0 2 50)} "PRELOAD_TTL" 30000 "preload-cache-get" {:upvalue-count 0 :arity 2 :constants ("dict-get" "nil?" ">" "-" "now-ms" "get" "timestamp" "PRELOAD_TTL" "dict-delete!") :bytecode (16 0 16 1 52 0 0 2 17 2 16 2 52 1 0 1 33 4 0 2 32 52 0 20 4 0 48 0 16 2 1 6 0 52 5 0 2 52 3 0 2 20 7 0 52 2 0 2 33 13 0 16 0 16 1 52 8 0 2 5 2 32 11 0 16 0 16 1 52 8 0 2 5 16 2 50)} "preload-cache-set" {:upvalue-count 0 :arity 4 :constants ("dict-set!" "dict" "text" "content-type" "timestamp" "now-ms") :bytecode (16 0 16 1 1 2 0 16 2 1 3 0 16 3 1 4 0 20 5 0 48 0 52 1 0 6 52 0 0 3 50)} "classify-trigger" {:upvalue-count 0 :arity 1 :constants ("get" "event" "every" "=" "poll" "intersect" "load" "revealed") :bytecode (16 0 1 1 0 52 0 0 2 17 1 16 1 6 1 2 0 52 3 0 2 33 7 0 5 1 4 0 32 58 0 6 1 5 0 52 3 0 2 33 7 0 5 1 5 0 32 40 0 6 1 6 0 52 3 0 2 33 7 0 5 1 6 0 32 22 0 6 1 7 0 52 3 0 2 33 7 0 5 1 7 0 32 4 0 5 1 1 0 50)} "should-boost-link?" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "href" "not" "starts-with?" "#" "javascript:" "mailto:" "browser-same-origin?" "dom-has-attr?" "sx-get" "sx-post" "sx-disable") :bytecode (20 0 0 16 0 1 1 0 48 2 17 1 16 1 6 33 119 0 5 16 1 1 4 0 52 3 0 2 52 2 0 1 6 33 101 0 5 16 1 1 5 0 52 3 0 2 52 2 0 1 6 33 83 0 5 16 1 1 6 0 52 3 0 2 52 2 0 1 6 33 65 0 5 20 7 0 16 1 48 1 6 33 53 0 5 20 8 0 16 0 1 9 0 48 2 52 2 0 1 6 33 34 0 5 20 8 0 16 0 1 10 0 48 2 52 2 0 1 6 33 15 0 5 20 8 0 16 0 1 11 0 48 2 52 2 0 1 50)} "should-boost-form?" {:upvalue-count 0 :arity 1 :constants ("not" "dom-has-attr?" "sx-get" "sx-post" "sx-disable") :bytecode (20 1 0 16 0 1 2 0 48 2 52 0 0 1 6 33 34 0 5 20 1 0 16 0 1 3 0 48 2 52 0 0 1 6 33 15 0 5 20 1 0 16 0 1 4 0 48 2 52 0 0 1 50)} "parse-sse-swap" {:upvalue-count 0 :arity 1 :constants ("dom-get-attr" "sx-sse-swap" "message") :bytecode (20 0 0 16 0 1 1 0 48 2 6 34 4 0 5 1 2 0 50)} {:library (web engine) :op "import"}) :bytecode (1 0 0 112 5 1 1 0 112 5 1 2 0 112 5 1 5 0 1 6 0 1 7 0 1 8 0 1 9 0 52 4 0 5 128 3 0 5 1 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 51 19 0 128 18 0 5 51 21 0 128 20 0 5 51 23 0 128 22 0 5 51 25 0 128 24 0 5 51 27 0 128 26 0 5 51 29 0 128 28 0 5 51 31 0 128 30 0 5 51 33 0 128 32 0 5 51 35 0 128 34 0 5 51 37 0 128 36 0 5 51 39 0 128 38 0 5 51 41 0 128 40 0 5 51 43 0 128 42 0 5 51 45 0 128 44 0 5 51 47 0 128 46 0 5 51 49 0 128 48 0 5 51 51 0 128 50 0 5 51 53 0 128 52 0 5 51 55 0 128 54 0 5 51 57 0 128 56 0 5 51 59 0 128 58 0 5 1 61 0 128 60 0 5 51 63 0 128 62 0 5 51 65 0 128 64 0 5 51 67 0 128 66 0 5 51 69 0 128 68 0 5 51 71 0 128 70 0 5 51 73 0 128 72 0 5 1 74 0 112 50)))