This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-29
Channels
- # beginners (10)
- # cider (10)
- # cljs-dev (17)
- # clojure (14)
- # clojure-losangeles (1)
- # clojure-spec (1)
- # clojure-uk (3)
- # clojurescript (49)
- # core-async (5)
- # css (1)
- # datomic (2)
- # duct (26)
- # emacs (13)
- # figwheel (6)
- # figwheel-main (5)
- # garden (1)
- # keechma (6)
- # nrepl (1)
- # off-topic (6)
- # re-frame (52)
- # shadow-cljs (132)
- # spacemacs (4)
- # tools-deps (26)
(aset (object-array 1) 0 0)
emits a reflection warning. What is the correct way to hint this ?@leonoel does (def my-array (into-array Integer/TYPE [1 2 3]))
work? It’s the example from http://clojuredocs.org/clojure.core/aset
no, I need to store values of arbitrary types so the array can't be primitive and values must be boxed
not sure if this is a good idea, but no reflection warning: (aset (object-array 1) 0 (Long. 0))
for now my workaround is (aset (object-array 1) 0 (identity 0))
and this feels utterly clumsy
Is there a way to get more detailed error messages when parsing EDN? In my limited tests, edn/read-string
doesn’t say much about what was expected
@bbrinck I have not compared the error messages for invalid edn data between the edn reader built into Clojure vs. the one in the library tools.reader, but if it matters to you I would try some experiments to see.
I think both of those readers can take a Java LineNumberingPushbackReader and you can then get some line and column number info, either attached to the parsed data, or maybe also in the error messages.
Thanks for the idea on using LNPR - I used it to print better errors for EDN parsing errors in check-deps. Thanks!
@andy.fingerhut good ideas. Thanks!