Hi,

Am 24.01.2010 um 16:28 schrieb Manfred Lotz:

> user=> (ns my (:require clojure.contrib.classpath))
> nil
> my=>
> 
> which to me looks fine. 

No news is good news.

> But why does this fail?
> 
> my=> (classpath)
> java.lang.Exception: Unable to resolve symbol: classpath in this
> context (NO_SOURCE_FILE:2)

Because you used require. Try clojure.contrib.classpath/classpath instead.

You have the following possibilities to shorten that:

    (ns my
      (:require [clojure.contrib.classpath :as cp]))

    … (cp/classpath) …

or (with :only listing everything you want to import)

    (ns my
      (:use [clojure.contrib.classpath :only (classpath)]))

    … (classpath) …

Both of these are considered clean style. You can also include everything of a 
namespace with a pure :use (w/o :only) but be aware that that might do more 
than you want.

Sincerely
Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to