On Wed, Oct 7, 2009 at 5:57 PM, Mark Reid <[email protected]> wrote:
> I'm not sure if this is the "best" approach but I found that if you
>
> (use 'clojure.contrib.math)
>
> instead of require, it should work.
>
In practice, an unqualified 'use' form can be bad style, because your code
will contain symbols whose origin is unknown to a human reader. It also
unnecessarily risks collisions, if you refer different namespaces that might
define the same names.
Better:
(use '[clojure.contrib.math :only [lcm]]) ;; so you know where 'lcm'
comes from, and nothing else can collide
(require '[clojure.contrib.math :as math]) ;; allows you to write
(math/lcm x y), and nothing will collide
--
Abhishek Reddy
http://abhishek.geek.nz
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---