About (ns (:require [ x :refer :all]))

1,079 views
Skip to first unread message

Максим Карандашов

unread,
Jun 3, 2014, 7:31:48 AM6/3/14
to clojur...@googlegroups.com
I know that currently we don't cat use (ns some.ns (:require [some.dep :refer :all])).

But wiki says (https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#namespaces): "You must *currently* use the ns form only with the following caveats..."

Are there any plans to implement this features or not?

David Nolen

unread,
Jun 3, 2014, 7:49:32 AM6/3/14
to clojur...@googlegroups.com
No plans to implement that feature.

David



--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Roman Scherer

unread,
Jun 4, 2014, 3:35:51 PM6/4/14
to clojur...@googlegroups.com
Apart from using "bad style" when requiring all symbols from
another namespace, are there any technical reasons this is not
supported in ClojureScript? Just curious ...

David Nolen

unread,
Jun 4, 2014, 3:54:07 PM6/4/14
to clojur...@googlegroups.com
It's just bad style and as far I know the only reason it hasn't changed in Clojure is because the core team is very adamant about preserving backwards compatibility when possible. The conspicuous lack of naked :use in ClojureScript was intentional.

David

Nikita Beloglazov

unread,
Jun 5, 2014, 9:52:50 AM6/5/14
to clojur...@googlegroups.com
I would argue that it is a bad style in every case. In Quil (http://github.com/quil/quil) it is pretty handy to :refer :all of quil.core and use functions from it without need to prefix every call with q/

But given that ClojureScript not going to support it we'll think about how to deal with it when migrating Quil to ClojureScript.

Nikita

Andrew Stoeckley

unread,
Jun 21, 2014, 4:53:13 AM6/21/14
to clojur...@googlegroups.com
I agree except in the case when you have macros from the same namespace, i.e. file.cljs and file.clj. It would be nice if file.cljs could refer all macros in file.clj since they are conceptually thought of as the same namespace. After all, the :include-macros feature allows you think of these two files as being the same namespace, so an ability to work in the clojurescript portion without prefixing the macros from the clojure version would feel natural.

Piotr Kozbial

unread,
Mar 9, 2016, 10:29:48 AM3/9/16
to ClojureScript
Oh great, start restricting language features to enforce good style... Good luck.
Is there a better way to tell your users that they're stupid?

Leon Grapenthin

unread,
Mar 10, 2016, 6:46:07 AM3/10/16
to ClojureScript
Agreed. If it is considered bad style I guess it should be removed from Clojure examples like in core.logic as well.

Also Clojure should emit a warning that :use is discouraged.

However I also disagree on the premise that it is bad style in all cases. While likely to be overused by beginners it is useful in certain cases as yours and many other libraries before yours have uncovered.
Reply all
Reply to author
Forward
0 new messages