Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

CLJ accepts multiple :require declarations in ns form.
CLJS allows only one declaration.

Which behavior is correct?
Can we request for support of multiple “requires” in CLJS?

1 Answer

+1 vote
by
selected by
 
Best answer

It looks like they did it on purpose. See https://clojure.atlassian.net/browse/CLJS-254 "throw error if multiple :require, :use, :require-macros, etc clauses".

That's not the only difference! For more, see the Namespaces part of the "Differences from Clojure" page, https://clojurescript.org/about/differences#_namespaces.

Anyway, the path of least resistance, when writing cljc files that should be portable, is to use ClojureScript's (more restrictive) ns conventions.

By the way, what do you like about multiple :require clauses?

by
> By the way, what do you like about multiple :require clauses?

I found it convenient in some cases which were discussed in context of linting by clj-kondo
https://github.com/borkdude/clj-kondo/issues/792
...