This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-16
Channels
- # announcements (62)
- # babashka (12)
- # babashka-sci-dev (73)
- # beginners (16)
- # biff (10)
- # calva (65)
- # cider (13)
- # clerk (8)
- # clojure (31)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-spec (24)
- # clojure-uk (5)
- # clojuredesign-podcast (18)
- # clojurescript (18)
- # dev-tooling (2)
- # emacs (30)
- # etaoin (4)
- # gratitude (3)
- # hyperfiddle (20)
- # integrant (2)
- # jobs (4)
- # kaocha (7)
- # malli (1)
- # observability (11)
- # off-topic (11)
- # pathom (12)
- # podcasts-discuss (7)
- # portal (12)
- # quil (3)
- # re-frame (6)
- # releases (1)
- # sql (22)
- # squint (5)
- # testing (79)
- # tools-deps (3)
- # xtdb (20)
I'm having an issue with sending \c
char values to portal. they show up as a wrapped value something like pU {code: 40, P: 2153775104, aa: 0}
in the devtools. 40 = ASCII for (
which is the character that's supposed to be. but that value does not pass char?
called from a custom view.
CLJS is expecting 1-length strings, (defn char? [x] (and (string? x) (== 1 (.-length x))))
Ohh dang, I didn't even know that was a thing in cljs 😂 https://github.com/djblue/portal/blob/master/src/portal/runtime/cson.cljc#L277-L298 is how chars are represented in cljs
Might need to provide a custom version of that fn for sci that can check this type and do the default thing maybe :thinking_face:
is there a #?(:sci ...)
form? if not I guess I could do something like #?(:cljs (and (object? x) (number? (.code x))))
that's close enough for my purposes; I'm just trying to tell apart strings, vectors, maps and chars.
ah, that would work.
there's a weird inconsistency here. if I
(p/eval-str "\\c")
I get "c"
, ie. a 1-length string in CLJS fashion.
I guess p/eval-str
is plain CLJS, while the values sent via tap>
are sci values? but that means I can't write #?(:portal ...)
in a ns required by my custom viewer and then p/eval-str
it; that's :cljs
.