Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Clojure 1.4 what is the use of refer within require?

Tags:

clojure

What advantage does using :refer in :require have over using :only in :use? Are the following synonymous?

(ns so.example (:use [my.lib :only [function]])) 

and

(ns so.example (:require [my.lib :refer [function]])) 
like image 233
Andrew Avatar asked Apr 27 '12 21:04

Andrew


1 Answers

Main idea of adding :refer to :require is to get rid completely of :use, leaving only one operator to load other packages. You can emulate existing :use with (:require [my.lib :refer :all])...

like image 185
Alex Ott Avatar answered Sep 28 '22 05:09

Alex Ott