You cannot post messages because only members can post, and you are not currently a member.
Description:
Discussion of the Clojure programming language
|
|
|
Does new ns macro work with add-classpath?
|
| |
Here's what happens: (add-classpath "file:///home/gracin/src/works paces/main/maven-cljexec-plugi n/target/classes") Under target/classes there's fileutils/fileutils.clj file. (ns testing (:require fileutils)) Could not locate Clojure resource on classpath: fileutils/fileutils.clj [Thrown class java.io.FileNotFoundException]... more »
|
|
Exception while setting namespace from Java
|
| |
Hi! Why is the following code throwing an exception? PushbackReader rdr = new PushbackReader( new StringReader( "(in-ns 'user)" ) ); Object input = LispReader.read(rdr, false, null, false ); clojure.lang.Compiler.eval( input ); java.lang.IllegalStateExceptio n: Can't change/establish root binding... more »
|
|
Clojure Robustness
|
| |
Any opinions on whether Clojure is solid enough to be used in actual
production systems? Obviously it's JVM based, which is, and hopefully
any issues would be caught per normal testing, and fixed or worked-
around, but wondering what general thoughts on the matter are. As a
backup plan I figure logic could always be shifted more towards Java... more »
|
|
clojure/ns and gen-and-save-class
|
| |
I think there's a problem with the new clojure/ns and gen-and-save-
class.
Suppose you define:
(clojure/ns com.example
(:use clojure.contrib.pred))
(defn MyClass-close [this]
(println "Hello, World!"))
And you generate a .class file with:
(gen-and-save-class... more »
|
|
Should meta :file include namespace/package path?
|
| |
Hi,
With recent unified namespace and package, should meta :file include
package path as well?
user=> (require '(clojure.contrib sql))
nil
user=> (def src (:file ^#'clojure.contrib.sql/with-co nnection))
...user=> src
"sql.clj"
user=> (.getResource (clojure.lang.RT/baseLoader) src)
nil
user=> (.getResource (clojure.lang.RT/baseLoader) "clojure/contrib/sql/... more »
|
|
Using a Timer in Clojure
|
| |
I would like to have a java.util.Timer running in my Clojure webapp.
Once per week, some time each Friday, the code the timer calls would
send out an e-mail with news to a list of recipients. I have never
used Timers nor worked with threads in Java so this is kind of new
ground to me. I found some piece of code on Sun's site (http://... more »
|
|
Local recursive lazy sequences
|
| |
Hi! Is there a way to have locally bound recursive lazy sequences in Clojure? I'd like to define a function that uses a lazy seq as an interim result, so i wouldn't want to use a top-level def. I'll try to give a short example. You can define the sequence of fibonacci numbers lazily-recursively like this:... more »
|
|
avoiding duplication using multi-methods
|
| |
Hello,
I have a situation in which different multi-methods
need similar behavior with different arguments.
So they call the same function (one-or-two below)
with the arguments. E.g.
(defmulti what-num (fn [x] x))
(defn one-or-two [x] (println "saw one or two: " x))
(defmethod what-num :one [x] (one-or-two x))... more »
|
|
remove-ns before loading lib?
|
| |
One of the downsides of interactive development and testing using the REPL is the fact that an old definitions in a lib's namespace can linger in memory after its source code has been deleted from the lib. One can relaunch Clojure to be sure of clearing that situation, but that often loses some desirable context. I'm proposing a change to... more »
|
|
Discrepancies between boot.clj and API Docs
|
| |
Hello Rich, I noticed a difference between boot.clj and the API Docs. I know that there are internal definitions, which are not supposed to be used by the user. New functions might also take some time, before they show up in the docs. But I'm missing for example delay and force. I found myself implementing... more »
|
|
|