Out of curiosity - what is the correct form in this case?
Ed: I'm guessing a key => list of deps, maybe?
Re:Clojure Turns 15 panel discussion video
by grumpyprole on Monday February 13, 2023 @03:39PM
(#34780066)
I think you might be asking for a type :)
Re:Clojure Turns 15 panel discussion video
by jdminhbg on Monday February 13, 2023 @03:44PM
(#34780138)
Not really. This is a syntactic error, not a type error.
To expand, this is the equivalent of something like {"a": 1, "b":}. The type checker in something like Typescript wouldn't ever come into play, because it's not legal syntax to begin with.
Re:Clojure Turns 15 panel discussion video
by grumpyprole on Monday February 13, 2023 @09:15PM
(#34784291)
The parent was asking for the correct form, the syntax of EDN is necessary but not sufficient to specify this. A type (or a schema) is needed. Even if documented manually ad-hoc, that is better than nothing and would stop people needed to search the internet for examples.
Re:Clojure Turns 15 panel discussion video
by roenxi on Wednesday February 15, 2023 @05:09AM
(#34801923)
It should be:
{:deps
{ring/ring-devel {:mvn/version "1.9.6"}
ring/ring-core {:mvn/version "1.9.6"}}}
There was one too many map.
Re:Clojure Turns 15 panel discussion video
by puredanger on Monday February 13, 2023 @04:40PM
(#34781041)
These are useful comments and issues are welcome at https://github.com/clojure/clojure-site/issues
Re:Clojure Turns 15 panel discussion video
by roenxi on Wednesday February 15, 2023 @05:07AM
(#34801918)
smoothly changes gears ... although of course there can be no question that the deps documentation is managed by a man of patience, talent and extreme skill to whom we are all thankful.
Sorry, I had a bad time learning deps and the frustration still haunts me.
Re:Clojure Turns 15 panel discussion video
by __jem on Monday February 13, 2023 @07:54PM
(#34783580)
> a multi-dependency project in the getting started page
That's because they basically don't support monorepo multi-module projects. It's incredibly tedious and makes me long for something like Maven or Gradle (tools that otherwise are often too complicated).
How do you mean? You can specify local (fs) dependencies fine, which is presumably what you want in that scenario?
(I regularly contribute to a monorepo like this, though admittedly the top-level components are relatively disjoint.)
Re:Clojure Turns 15 panel discussion video
by __jem on Monday February 13, 2023 @08:57PM
(#34784106)
I mean, you can hack something together with local dependencies, yes, but there's no out of the box way to build and test everything together, or to do things like pin dependency versions across projects, have projects inherit shared configuration, etc. We end up creating a bunch of pseudo-projects that contain things like single dependencies, but this blurs the line between build time concerns and actual source code. As with everything in clojure, you can write it all yourself using something like tools.build, but it's not convenient and clearly not a first class use case.
If a newbie is trying to debug
=> Error building classpath. Error reading edn. Map literal must contain an even number of formsThey have to notice that while they got 80% of their maps right, the file itself if a map with 3 forms. This is compounded by the fact that there are no examples of a multi-dependency project in the getting started page! If you know Clojure, this is an easy puzzle. For rookies, they didn't use (map) so the error message will probably trick some percent of them.
I don't think the deps documentation has been validated to provide what people actually want to know. Technically it is probably thorough, but "Superb" is a high bar it does not reach.
Probably the proper approach is learning deps by copying other people. Trying to learn it from the docs didn't work for me (it did for the rest of Clojure, so that was an unpleasant change).