是否可以使用:refer:all在ClojureScript:require? [英] Is it possible to use :refer :all in a ClojureScript :require?

查看:375
本文介绍了是否可以使用:refer:all在ClojureScript:require?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我尝试编译它时,我得到:

  clojure.lang.ExceptionInfo::refer必须后跟一系列符号:require 

我在网上找到一些倾斜的引用,但没有在哪里阐明是否应该能够使用:refer :



如果我不能这样做,这个限制的原因是什么?

解决方案

不,这是故意不可能的。最近与ClojureScript邮件列表相关的对话 :refer:all ,它似乎永远不会被支持。




这只是不好的风格,我知道在Clojure没有改变
的唯一原因是因为核心团队非常强烈的
在可能的情况下保持向后兼容性。明显缺乏
的裸体:在ClojureScript中使用是故意的。



I'm just trying out ClojureScript, starting out by converting something I wrote in Clojure into cljx.

When I try to compile it I get:

clojure.lang.ExceptionInfo: :refer must be followed by a sequence of symbols in :require 

I'm finding some oblique references online, but nowhere where it's spelled out whether I should be able to use a :refer :all in a ClojureScript program.

If I can't do it, what's the reason for this restriction?

解决方案

No, it's intentionally not possible. There was a conversation on the ClojureScript mailing list recently related to :refer :all and it looks like it will never be supported.

To quote David Nolen from that thread:

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.

这篇关于是否可以使用:refer:all在ClojureScript:require?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆