2008-08-21
| 19:02 | ppjt | Hi all |
| 19:02 | ppjt | Quick question about user.clj & the classpath |
| 19:04 | ppjt | In short, when the docs say that Clojure will load a file named "user.clj" that's on the classpath, "classpath" just means the Java classpath, correct? I ask because I have a user.clj on my classpath & it doesn't seem to be picked up |
| 19:09 | drewr | ppjt: What's in it? |
| 19:10 | ppjt | Function defs, a macro def |
| 19:10 | ppjt | In the user ns |
| 19:10 | drewr | Put (throw (Exception. "user.clj!")) in there and see if it gets triggered when you start the JVM. |
| 19:12 | drewr | You could also do (.getProperty System "java.class.path") from the REPL to see if the classpath is what you think it is. |
| 19:13 | ppjt | drewr: on the latter, user.clj is in the same dir as the Clojure jar, but I'll check |
| 19:13 | drewr | The dir that clojure.jar is in is not necessarily in the classpath. |
| 19:14 | drewr | That just proves that .../path/to/clojure.jar is in the classpath. |
| 19:14 | ppjt | You're right, but mine is -- I invoke clojure like `java clojure.lang.Repl` |
| 19:15 | ppjt | Just threw the exception -- didn't take; thanks for the suggestion, though |
| 19:16 | drewr | If the exception got thrown, then user.clj is being read. |
| 19:16 | drewr | Your code in the file isn't doing what you think is perhaps. |
| 19:16 | drewr | s/think is/think it is/ |
| 19:16 | ppjt | Right, it didn't get thrown is what I meant |
| 19:16 | drewr | Oh. |
| 19:17 | drewr | So does java.class.path contain the directory that user.clj is in? |
| 19:19 | ppjt | Funny, when I grab the classpath property from System, I only get the current dir (".") |
| 19:20 | drewr | Now grab user.dir and make sure it's right. |
| 19:26 | ppjt | drewr: Gotta run; thanks |
| 19:58 | ericthor | is there a way to type hint java arrays for variadic functions? |
| 20:29 | ericthor | if (+ 1) returns 1 and (merge {}) returns {} should not (union #{}) return #{} and not throw an error? Any thoughts? |
| 22:52 | Chouser | sounds good to me. :-) |