This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-24
Channels
- # adventofcode (11)
- # asami (1)
- # babashka (9)
- # beginners (81)
- # calva (85)
- # circleci (4)
- # clojure (32)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-uk (2)
- # clojurescript (28)
- # cursive (5)
- # fulcro (3)
- # honeysql (1)
- # introduce-yourself (1)
- # jobs-discuss (1)
- # missionary (1)
- # off-topic (1)
- # other-languages (42)
- # re-frame (12)
- # releases (1)
- # shadow-cljs (1)
> Spec > Currently this specification is casual, as we gather feedback from implementors. A more rigorous e.g. BNF will follow. Do we have a rigorous EDN spec?
If one were, I would expect it would be published in this repo: https://github.com/edn-format/edn. There is not one there, so I believe the answer is "no, no more rigorous than is in that repo".
How to convert json to map in clojure ?
You can use jsonista https://github.com/metosin/jsonista/
{"event":[{"event_dates":[{"event_date_timestamp":"2016-01-19T19:00:00"}, {"event_date_timestamp":"2016-09-13T19:00:00"}, {"event_date_timestamp":"2017-02-27T19:00:00"}, {"event_date_timestamp":"2017-04-12T19:00:00"}]}]}
I have this type of data and want to convert it into clojure map
I am getting this error while importing namespace
I think that's because you dont have it installed
Thank you bro it did work for me
FYI if you don't need the extra features that these libraries offer (like speed), clojure.data.json has no dependencies and to me is usually a better first choice
I have date like this "2016-01-19T19:00:00"
how can I generate the formatted date using clojure, in cljs I was using js/Date. but it is not available in clojure
Java time is... complicated. Interop with java.time
is a popular choice but if you don't like that there's a bunch of libraries that offer a more idiomatic API. Avoid anything based on joda time (it's an older way of handling time in java)
what about clj-time ?
I highly recommend juxt/time
as a library that will interop with both Clojure and Clojurescript.
clj-time is deprecated and should not be used unless you are still on Java 7 (as it says in the readme). Also, this sort of question really belongs in #beginners
@U01GXCWSRMW you are referring to juxt/tick
, right? I am very happy with that one as well.
java.time worked fine for me
Yes. Mistyped while tired. 😀
I have a list of urls in a vector [url1 url2 .. urln]
and I am trying to do a map on it using code given this {:response (doall (map (fn [url]
(let [response (client/get url
{:query-params {:auth "KesmU1sqxt8wS"}})
;response-data (:rows (:data (json/read-str (:body response) :key-fn keyword)))
]
response-data
)))
urls)}
but I am getting error and not getting a response whereas when I am calling client/get
it is working perfectly fine, what could be the problem in that ?
:message clojure.core$map$fn__5880 cannot be cast to java.lang.Number
something like this
First of all, please format your code so it's readable. Don't do it via UI - do it via triple backticks, then it will be a multiline block with proper formatting.
Second of all, whenever you post errors, post them with full stacktrace. Just the message is often useless.
Also, your code above seems to be simply broken since the line that binds response-data
is commented out.
should I repost this with proper format ?
And finally, as Sean has mentioned twice already, please direct such questions to #beginners. They really do belong there.
oops that is my mistake I accidentally posted in the clojure sorry for the inconvenience