From cc26e3abbafc76e4855acb70875bf24aad372deb Mon Sep 17 00:00:00 2001 From: Yogthos Date: Fri, 26 Jun 2026 20:42:14 -0400 Subject: [PATCH] Expose jolt.host/throwable A library that throws a typed host exception (an http client raising java.net.ConnectException) needs (class e), instance?, .getMessage and ex-message to all reflect the named class. jolt-host-throwable already builds that value; expose it as a jolt.host seam so libraries stop hand-rolling a :jolt/ex-info table that carries only the class (its .getMessage/ex-message return nil). --- host/chez/rt.ss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/host/chez/rt.ss b/host/chez/rt.ss index 24d6659..237f87d 100644 --- a/host/chez/rt.ss +++ b/host/chez/rt.ss @@ -110,6 +110,11 @@ ;; (pr-str (def x 1)) is "#'ns/x". The prelude's def-var! forms discard the ;; return, so this is transparent there. (define (def-var! ns name v) (let ((c (jolt-var ns name))) (var-cell-root-set! c v) (var-cell-defined?-set! c #t) c)) +;; jolt.host/throwable — build a typed throwable a library can throw so (class …), +;; instance?, .getMessage and ex-message all reflect the named JVM class (e.g. an +;; http client throwing java.net.ConnectException). Strictly better than a +;; hand-rolled :jolt/ex-info table, which carries only the class. +(def-var! "jolt.host" "throwable" jolt-host-throwable) ;; var def-time metadata: the :def emit passes the def's reader meta ;; (^:private / ^Type tag / docstring -> {:doc}) here, stored in an eq side-table ;; keyed by the cell. jolt-meta (natives-meta.ss) merges it onto {:ns :name},