This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-17
Channels
- # aleph (57)
- # announcements (2)
- # babashka (11)
- # beginners (55)
- # calva (18)
- # cider (37)
- # clj-kondo (24)
- # clojure (18)
- # clojure-europe (80)
- # clojure-nl (2)
- # clojure-norway (22)
- # clojure-uk (7)
- # clojured (1)
- # clojurescript (24)
- # data-science (9)
- # datomic (45)
- # events (1)
- # gratitude (4)
- # humbleui (30)
- # hyperfiddle (7)
- # introduce-yourself (2)
- # malli (3)
- # missionary (12)
- # music (1)
- # off-topic (33)
- # re-frame (3)
- # reagent (11)
- # ring (24)
- # shadow-cljs (13)
- # sql (3)
- # tools-deps (4)
Is GraalVM Polyglot the most legitimate option for running web assembly modules from Clojure? It seems like there's not a lot of JVM options
The only one I know of is asmble. Are there others?
https://github.com/wasmerio/wasmer-java maybe, it is a wrapper around the ffi approach
Is there a library with a sane string split function?
(str/split "" #"/")
=> [""]
(str/split "/" #"/")
=> []
(str/split "/a" #"/")
=> ["" "a"]
(str/split "/a/" #"/")
=> ["" "a"]
In the last two examples there’s data loss, that’s not sane. I am not able to recreate back the starting string in the last case
Hm passing -1 seems to help
Trailing empty strings are not returned - pass limit of -1 to return all.
is in the docstring(str/split "" #"/" -1)
=> [""]
(str/split "/" #"/" -1)
=> ["" ""]
(str/split "/a" #"/" -1)
=> ["" "a"]
(str/split "/a/" #"/" -1)
=> ["" "a" ""]
worked with java for a long time and never noticed that “feature”
Thanks everyone
seems that this is a wrapper around java's Pattern.split method https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#split-java.lang.CharSequence-int-
i'd prefer it to default to all, tbh, but sadly that's not how it is