If its left argument is nil, "intersection" throws a NPE (Clojure rev. 1235):
user=> (set/intersection nil #{1})
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (.printStackTrace *e)
java.lang.NullPointerException (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:418
For the first time I tried to use gen-class (using svn r1156), but
unfortunately compilation fails:
u...@computer /tmp $ mkdir test
u...@computer /tmp $ cd test/
u...@computer /tmp/test $ mkdir -p clojure/examples
u...@computer /tmp/test $ gvim clojure/examples/instance.clj ;copied
the source fr
In one of my data structures I have a vector as a buffer where things
are appended to. In addition the things in that buffer sometimes get
modified using map or filter. Now as map and filter return sequences I
wonder how to get a vector back efficiently. I need a vector in order
for conj to append
Currently agent errors are only reported when the agent is derefenced
or further actions are dispatched to the agent. It would be great if
one can get immediate notification of agent errors maybe through a
callback.
Thanks,
nt
--~--~-~--~~~---~--~~
You received th
On Thu, 2008-10-30 at 01:37 -0700, mb wrote:
> I lookep up the implementation of proxy-super. It replaces the
> method temporarily. So proxy-super basically doesn't work for
> methods with multiple implementations for different arglists,
> since only the actually called method-arglist combination
On Wed, 2008-10-29 at 23:44 -0700, mb wrote:
> But proxy-super to the rescue: You may try the following snippet
> for the write method:
Nice. Never heard of proxy-super before. Would be nice to mention it on
the Java interop page and not only on the API page.
>
>(write
> ([x]
>
Consider the following code which attempts to redefine clojure/*out*:
(ns test
(:refer-clojure))
(def output System/out)
(def output-stream
(let [buffer (new java.io.ByteArrayOutputStream)]
(proxy [java.io.OutputStream] []
(flush []
(.append output (.toString buffer "UTF-
On Fri, 2008-10-10 at 12:46 -0700, Mike Hinchey wrote:
> It's usually advised to avoid eval.
Many thanks Mike. I would like to avoid eval, but I am too stupid.
However I would love to find out how to do it. If you could give me
hunch I would be more than happy.
> See dothread-keeping in
> http:
I still try to find a way to make threads inherit thread-local
bindings established via binding in the parent thread. I searched for
a function to get the thread bindings but couldn't find one. Did I
miss anything? So I added getThreadBindings() to Var.java:
diff --git a/trunk/src/jvm/clojure/lan
On Thu, 2008-10-09 at 22:06 +0200, ntupel wrote:
> After further investigation and experimentation with macros I finally
> managed to trigger a NullpointerException:
>
> user=> (defmacro on-thread [env exp] `(doto (new Thread #(binding ~env
> (~exp))) (start)))
Ignore me.
On Thu, 2008-10-09 at 02:30 -0700, [EMAIL PROTECTED] wrote:
> As bindings are not inherited by new threads, how can this be done
> without actually changing the expressions that are evaluated?
>
> I know that in March it was briefly discussed, but wouldn't it be
> useful to have a binding variant
The Clojure wikibook has an example implementation of a Repl over a
socket
(http://en.wikibooks.org/wiki/Clojure_Programming#Simple_REPL_on_a_Socket). I
wonder how to solve the problem of showing output if somewhere in the evaluated
expression, a new thread is created that will eventually print
The Clojure wikibook has an example implementation of a Repl over a
socket
(http://en.wikibooks.org/wiki/Clojure_Programming#Simple_REPL_on_a_Socket).
I wonder how to solve the problem of showing output if somewhere in
the evaluated expression, a new thread is created that will eventually
print so
On Tue, 2008-09-30 at 17:29 -0400, Stuart Halloway wrote:
> For your specific case you should probably be using contains?, which
> works for both.
No. contains? is meant for maps, i.e. when applied to vectors it checks
against indexes:
user=> (contains? [1 2 3] 0)
true
--~--~-~--~--
The following looks weird to me:
Clojure
user=> (.contains [1 2 3] 2)
true
user=> (true? (.contains [1 2 3] 2))
false
AFAICS true? is implemented using identical? which tests by reference
equality. Now since Java boolean values are boxed into Booleans we have
not only Boolean.TRUE. Maybe true? (
On Tue, 2008-09-09 at 07:26 -0700, Rich Hickey wrote:
> Certainly there are areas where there could be more explicit messages,
> but the detection and reporting of errors has a cost (in time,
> sometimes runtime, effort, code size and complexity) and I don't want
> to incur that cost unless it is
On Wed, 2008-09-10 at 16:47 +1100, Brett Morgan wrote:
> On Wed, Sep 10, 2008 at 4:38 PM, ntupel <[EMAIL PROTECTED]> wrote:
> >
> > On Tue, 2008-09-09 at 23:57 +1000, Brett Morgan wrote:
> >> On Tue, Sep 9, 2008 at 10:31 PM, [EMAIL PROTECTED]
> >> <[EMAIL
On Tue, 2008-09-09 at 23:57 +1000, Brett Morgan wrote:
> On Tue, Sep 9, 2008 at 10:31 PM, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> >
> > On Sep 9, 11:26 am, "Brett Morgan" <[EMAIL PROTECTED]> wrote:
> >> For C, protection against circular dependencies is on the head of the
> >> programmer,
On Mon, 2008-09-08 at 13:15 -0700, Rich Hickey wrote:
> Hmm, don't do that?
>
> Seriously, how is this a bug in Clojure, and not a bug in your
> program, which resulted in an exception which easily leads you to your
> problem?
Well, first of all this bug in a users program results in undefined
b
(ns test
(:require test))
results in:
clojure.lang.Compiler$CompilerException: test.clj:0: null
at clojure.lang.Compiler.analyzeSeq(Compiler.java:3824)
at clojure.lang.Compiler.analyze(Compiler.java:3657)
at clojure.lang.Compiler.eval(Compiler.java:3848)
at cloj
20 matches
Mail list logo