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

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

问题描述

我只是在尝试 ClojureScript,首先将我在 Clojure 中编写的内容转换为 cljx.

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 

我在网上找到了一些间接引用,但没有任何地方说明我是否应该能够在 ClojureScript 程序中使用 :refer :all.

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?

推荐答案

不,这是故意不可能的.最近在 ClojureScript 邮件列表上有一个对话:refer :all 看起来它永远不会被支持.

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.

引用来自该线程的 David Nolen:

To quote David Nolen from that thread:

这只是糟糕的风格,据我所知,它没有的唯一原因Clojure 的变化是因为核心团队非常坚持尽可能保持向后兼容性.明显的不足的 : 在 ClojureScript 中使用是有意的.

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.

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

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