Add type annotations to remaining untyped spec params

trampoline (eval.sx), signal/deref (signals.sx), aser (adapter-sx.sx).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 22:57:20 +00:00
parent ce7ad125b6
commit a69604acaf
4 changed files with 5 additions and 5 deletions

View File

@@ -14,7 +14,7 @@
// ========================================================================= // =========================================================================
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } }); var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
var SX_VERSION = "2026-03-11T22:28:29Z"; var SX_VERSION = "2026-03-11T22:53:48Z";
function isNil(x) { return x === NIL || x === null || x === undefined; } function isNil(x) { return x === NIL || x === null || x === undefined; }
function isSxTruthy(x) { return x !== false && !isNil(x); } function isSxTruthy(x) { return x !== false && !isNil(x); }

View File

@@ -21,7 +21,7 @@
(serialize result))))) (serialize result)))))
(define aser (define aser
(fn (expr (env :as dict)) (fn ((expr :as any) (env :as dict))
;; Evaluate for SX wire format — serialize rendering forms, ;; Evaluate for SX wire format — serialize rendering forms,
;; evaluate control flow and function calls. ;; evaluate control flow and function calls.
(set-render-active! true) (set-render-active! true)

View File

@@ -55,7 +55,7 @@
;; -------------------------------------------------------------------------- ;; --------------------------------------------------------------------------
(define trampoline (define trampoline
(fn (val) (fn ((val :as any))
;; Iteratively resolve thunks until we get an actual value. ;; Iteratively resolve thunks until we get an actual value.
;; Each target implements thunk? and thunk-expr/thunk-env. ;; Each target implements thunk? and thunk-expr/thunk-env.
(let ((result val)) (let ((result val))

View File

@@ -42,7 +42,7 @@
;; -------------------------------------------------------------------------- ;; --------------------------------------------------------------------------
(define signal (define signal
(fn (initial-value) (fn ((initial-value :as any))
(make-signal initial-value))) (make-signal initial-value)))
@@ -55,7 +55,7 @@
;; the current value — no subscription, no overhead. ;; the current value — no subscription, no overhead.
(define deref (define deref
(fn (s) (fn ((s :as any))
(if (not (signal? s)) (if (not (signal? s))
s ;; non-signal values pass through s ;; non-signal values pass through
(let ((ctx (get-tracking-context))) (let ((ctx (get-tracking-context)))