This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-24
Channels
- # announcements (22)
- # babashka (33)
- # babashka-sci-dev (161)
- # beginners (25)
- # calva (57)
- # cider (6)
- # clara (6)
- # clerk (14)
- # clj-kondo (24)
- # clojars (10)
- # clojure (65)
- # clojure-austin (1)
- # clojure-conj (2)
- # clojure-europe (23)
- # clojure-miami (3)
- # clojure-nl (3)
- # clojure-norway (3)
- # clojure-uk (3)
- # clojurescript (28)
- # cursive (24)
- # datomic (136)
- # emacs (38)
- # graalvm (29)
- # graphql (3)
- # introduce-yourself (8)
- # jackdaw (4)
- # jobs-discuss (9)
- # malli (5)
- # nbb (36)
- # off-topic (11)
- # pathom (58)
- # polylith (2)
- # practicalli (1)
- # re-frame (5)
- # reagent (11)
- # releases (1)
- # remote-jobs (8)
- # sci (15)
- # shadow-cljs (31)
- # slack-help (2)
- # spacemacs (11)
- # sql (7)
- # tools-build (9)
What would a version of https://github.com/babashka/babashka/blob/master/src/babashka/impl/clojure/core.clj#L40-L56 look like in sci for cljs?
Trying to build something similar to https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/server.clj#L191 for sci in cljs
Specifically, trying to add it here https://github.com/djblue/portal/blob/master/src/portal/ui/sci.cljs#L34
I would like to correlate results with the forms that generated them, this is nice when the user submits multiple forms at one
Yeah, in cljs land, the reader you get back is an https://github.com/clojure/tools.reader/blob/master/src/main/cljs/cljs/tools/reader/reader_types.cljs#L102 which is a little different from clj land.
@U1G869VNV I think I can make this available in SCI as well, we have parse-next
, we could do parse-next+string
edamame already supports preserving the source string but as metadata, which won't work for numbers, etc
you will need to use this reader in that case: https://github.com/borkdude/edamame/blob/88564cb28533a80472e2350099acf1878c4cfd58/src/edamame/impl/parser.cljc#L828
(is (= "#(+ 1 2 3)" (:source (meta (p/parse-next (p/source-reader "#(+ 1 2 3)")
(p/normalize-opts {:all true :source true}))))))
A SCI + JNA example: https://twitter.com/borkdude/status/1618006680662605831 https://github.com/borkdude/jna-native-image-sci Thanks @smith.adriane for doing the initial research on this!