使用和要求之间的差异 [英] difference between use and require

查看:100
本文介绍了使用和要求之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释使用 require 之间的区别,无论是直接使用还是:在 ns 宏中使用:require

Can anyone explain the difference between use and require, both when used directly and as :use and :require in the ns macro?

推荐答案

require 加载libs(尚未加载)使用做同样的加上它指它们的命名空间与 clojure.core / refer 使用:exclude 等与 clojure.core / refer 一样。两者建议在 ns 中使用,而不是直接使用。

require loads libs (that aren't already loaded), use does the same plus it refers to their namespaces with clojure.core/refer (so you also get the possibility of using :exclude etc like with clojure.core/refer). Both are recommended for use in ns rather than directly.

这篇关于使用和要求之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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