MC Andre, if you put hello.clj in the src folder you should be able to do
(load "hello"). (load-file <file-name>)  should work for files not on the
classpath, so (load-file "hello.clj") means look for hello.clj in the
current working dir.

Pretty easy to inspect the classpath in the repl, e.g: (filter #(= (key %)
"java.class.path") (System/getProperties))

The project relative folders on my classpath is:
*  /test
*  /src
*  /dev-resources
*  /resources
*  /target/classes

"." is not on the classpath, and shouldn't normally be imo. "." just means
the working dir though.

Cheers,
Alf


On 27 March 2013 03:06, Leif <leif.poor...@gmail.com> wrote:

> I works for me if I run 'lein repl' *outside* of a project.  In that
> case, "" is on the classpath, so "." looks in the current directory.
>
> When you run 'lein repl' *inside* of a project, however, the top-level
> project directory is not on the classpath.  "." in this case probably means
> "look in the root of all directories on the classpath."  (I'm guessing;
> Java experts speak up.)
>
> --Leif
>
>
> On Tuesday, March 26, 2013 12:25:43 PM UTC-4, MC Andre wrote:
>>
>> I tried setting *compile-path* to ".", but Clojure still can't find
>> hello.clj.
>>
>> Trace:
>>
>> $ cat hello.clj
>> (ns hello
>>   (:gen-class))
>>
>> (defn -main [& args]
>>   (println "Hello World!\n"))
>>
>> $ lein repl
>> nREPL server started on port 4902
>> REPL-y 0.1.0-beta10
>> Clojure 1.4.0
>>     Exit: Control+D or (exit) or (quit)
>> Commands: (user/help)
>>     Docs: (doc function-name-here)
>>           (find-doc "part-of-name-here")
>>   Source: (source function-name-here)
>>           (user/sourcery function-name-here)
>>  Javadoc: (javadoc java-object-or-class-here)
>> Examples from clojuredocs.org: [clojuredocs or cdoc]
>>           (user/clojuredocs name-here)
>>           (user/clojuredocs "ns-here" "name-here")
>> user=> (load "hello")
>> FileNotFoundException Could not locate hello__init.class or hello.clj on
>> classpath:   clojure.lang.RT.load (RT.java:432)
>>
>> System:
>>
>> * Leiningen 2.0.0-preview10
>> * Clojure 1.4.0
>> * Java Java 1.7.0_17 Java HotSpot(TM) Client VM
>> * Windows XP
>>
>  --
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to