2009/4/3 Rich Hickey :
> Could you please submit an issue for that one?
No problem: http://code.google.com/p/clojure/issues/detail?id=102
Thanks,
Paul.
--
Iode Software Ltd, registered in England No. 6299803.
Registered Office Address: 12 Sancroft Drive, Houghton-le-Spring, Tyne
& Wear, DH5 8N
On Apr 3, 10:33 am, Paul Drummond wrote:
> The following works - note ActionListener is fully qualified:
>
> -
> user=> (.addActionListener (javax.swing.JButton.)
> (proxy [java.awt.event.ActionListener] []
> (actionPerformed [evt]
>
The following works - note ActionListener is fully qualified:
-
user=> (.addActionListener (javax.swing.JButton.)
(proxy [java.awt.event.ActionListener] []
(actionPerformed [evt]
(println "button press"
nil
-
Frantisek Sodomka wrote:
> On Mar 19, 12:58 pm, Jason Sankey wrote:
>> Also, is there somewhere I can contribute test cases for this to
>> prevent a future regression?
>
> Tests for clojure.zip can from now on go to test-clojure.clojure-zip:
> http://code.google.com/p/clojure-contrib/source/brow
On Mar 19, 12:58 pm, Jason Sankey wrote:
> Also, is there somewhere I can contribute test cases for this to
> prevent a future regression?
Tests for clojure.zip can from now on go to test-clojure.clojure-zip:
http://code.google.com/p/clojure-contrib/source/browse/trunk/src/clojure/contrib/test_c
Hi Frantisek,
Frantisek Sodomka wrote:
> On Mar 19, 11:37 pm, Jason Sankey wrote:
>> I pretty much have it working for the test-clojure suite now, although
>> I'm sure the code could use review by a more experienced eye. I've been
>> looking at adding the other two top-level suites (test-contri
On Mar 19, 11:37 pm, Jason Sankey wrote:
> I pretty much have it working for the test-clojure suite now, although
> I'm sure the code could use review by a more experienced eye. I've been
> looking at adding the other two top-level suites (test-contrib and
> datalog) too, but their test clojure
Hi Frantisek,
Frantisek Sodomka wrote:
> On Mar 19, 12:58 pm, Jason Sankey wrote:
>> Also, is there somewhere I can contribute test cases for this to
>> prevent a future regression?
>
> In order to contribute, you must fill-in and send The Contributor
> Agreement (CA) to Rich Hickey:
> http://c
On Mar 19, 12:58 pm, Jason Sankey wrote:
> Also, is there somewhere I can contribute test cases for this to
> prevent a future regression?
In order to contribute, you must fill-in and send The Contributor
Agreement (CA) to Rich Hickey:
http://clojure.org/contributing
Tests for clojure.core are
On Mar 19, 7:22 am, Christophe Grand wrote:
> Jason Sankey a écrit :
>
> > (if (and (branch? loc) (not (empty? (children loc
> > (recur (-> loc down rightmost))
> > loc))
>
> > Being new to both clojure and zip I admit there's still a good chance
> > that I have no idea what I'm talking
Hi Christophe,
On Mar 19, 11:22 am, Christophe Grand wrote:
> Jason Sankey a écrit :
>
> > (if (and (branch? loc) (not (empty? (children loc
> > (recur (-> loc down rightmost))
> > loc))
>
> > Being new to both clojure and zip I admit there's still a good chance
> > that I have no idea w
Jason Sankey a écrit :
> (if (and (branch? loc) (not (empty? (children loc
> (recur (-> loc down rightmost))
> loc))
>
> Being new to both clojure and zip I admit there's still a good chance
> that I have no idea what I'm talking about :).
>
No you are right and there's the same bug in
Hi All,
I've been teaching myself clojure and in the process am working on a
small program to manipulate an XML file. I figured this was a good
chance to try clojure.zip, but I'm having some difficulty. Being a
newbie I strongly suspected myself - but when I posed the question on
IRC the conclu
Thanks for explanation, all!
Frantisek
On 20 Ún, 20:57, Jason Wolfe wrote:
> It probably does an "identical?" call on a pair before calling
> compare, for efficiency. In other words, it may "work" on non-
> comparable types, but only when passed n instances of the exact same
> object:
>
> user
It probably does an "identical?" call on a pair before calling
compare, for efficiency. In other words, it may "work" on non-
comparable types, but only when passed n instances of the exact same
object:
user> (sorted-set '(1) '(1))
; Exception
user> (let [x '(1)] (sorted-set x x))
#{(1)}
This
It looks that it is more complicated than that:
user=> (sorted-set () ())
#{()}
user=> (sorted-set {} {})
#{{}}
user=> (sorted-set #{} #{})
#{#{}}
Frantisek
On 20 Ún, 20:33, Vincent Foley wrote:
> I'm pretty sure that sorted-set works only with values that are
> instances of a class that implem
I'm pretty sure that sorted-set works only with values that are
instances of a class that implements Comparable.
user=> (instance? Comparable [])
true
user=> (instance? Comparable {})
false
user=> (instance? Comparable ())
false
user=>
On Feb 20, 2:21 pm, Frantisek Sodomka wrote:
> sorted-set
sorted-set works for vectors, but doesn't work for lists, maps and
sets:
user=> (sorted-set [1 4])
#{[1 4]}
user=> (sorted-set [1 4] [1 4])
#{[1 4]}
user=> (sorted-set [4 1] [1 4])
#{[1 4] [4 1]}
user=> (sorted-set '(1 4))
#{(1 4)}
user=> (sorted-set '(1 4) '(1 4))
java.lang.ClassCastException: c
Hi,
After updating to r1295, I'm hitting an error in swank-clojure I can't
seem to fix. Here's a micro test:
(ns jochu.micro-test)
(defn deep-replace [smap coll]
(map #(if (or (seq? %) (vector? %))
(deep-replace smap %)
%)
(replace smap coll)))
(defn t-to-true [for
I don't know if this is expected, but I get a Nullpointerexception
when I implement a proxy function and the 'interface' isn't
'imported'. For example, I was refactoring some code and didn't carry
over the import and get this nullpointerexception error. Obviously, I
should just add the import, b
On Feb 3, 11:09 pm, Rich Hickey wrote:
> On Feb 3, 4:43 pm, Anand Patil
> wrote:
> No, it's not. as the docs for preduce say:http://clojure.org/api#preduce
>
> "Also note that (f base an-element) might be performed many times"
>
> in fact, an arbitrary number of times depending on how many pa
I got a 50% speedup using psort instead of sort with a compute-
intensive comparator and a 100 element sequence on a dual-core
machine.
That said, I found a faster way to do it: I separated the intensive
calculations from the comparator - just returning a numeric value. I
used pmap to get a seque
On Feb 3, 2009, at 10:32 PM, kyle smith wrote:
(map #(doto %1 (.add 2)) (doto (new java.util.ArrayList) (.add 1)))
user=> (map #(doto %1 (.add 2)) (doto (new java.util.ArrayList) (.add
1)))
java.lang.IllegalArgumentException: No matching method found: add for
class java.lang.Integer
T
(map #(doto %1 (.add 2)) (doto (new java.util.ArrayList) (.add 1)))
This seems like it should work, but does not. Can anyone confirm?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this
A month or so ago, I installed the ForkJoin library, and played around
with the clojure.parallel wrapper library, and I wasn't able to get a
single test to show a speed improvement on my dual core machine. In
contrast, pmap, which doesn't rely on the ForkJoin library, works just
fine. It makes m
On Feb 3, 4:43 pm, Anand Patil
wrote:
> Hi all,
>
> Messing around with preduce at the REPL I saw this:
>
> user=> (defn q [sofar new] (do (print new sofar"\n") (+ (+ 1 new)
> sofar)))
> #'user/q
> user=> (reduce q 0 [1 2
> 3])
> 1 0
> 2 2
> 3 5
> 9
> user=> (preduce q 0 [1 2
> 3])
> 3 2
> 6 1
Hi all,
Messing around with preduce at the REPL I saw this:
user=> (defn q [sofar new] (do (print new sofar"\n") (+ (+ 1 new)
sofar)))
#'user/q
user=> (reduce q 0 [1 2
3])
1 0
2 2
3 5
9
user=> (preduce q 0 [1 2
3])
3 2
6 1
8
It looks like preduce takes its arguments in the opposite order from
r
On Thu, Dec 18, 2008 at 9:08 PM, Stuart Sierra
wrote:
>
> On Dec 18, 6:05 pm, "Mark Volkmann" wrote:
>> If I understand correctly,
>>
>> (are (< 1 2, 5 7))
>>
>> is equivalent to
>>
>> (is (< 1 2))
>> (is (< 5 7))
>
> Not exactly. The first argument to "are" is a template expression,
> which is
On Dec 18, 6:05 pm, "Mark Volkmann" wrote:
> If I understand correctly,
>
> (are (< 1 2, 5 7))
>
> is equivalent to
>
> (is (< 1 2))
> (is (< 5 7))
Not exactly. The first argument to "are" is a template expression,
which is sort of like #(). The arguments to the template are symbols
named "_1"
If I understand correctly,
(are (< 1 2, 5 7))
is equivalent to
(is (< 1 2))
(is (< 5 7))
The following may be incorrect usage of are:
(are < 1 2, 5 7)
However, instead of complaining about the arguments, it hangs forever.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-~--~~
Using enumeration-seq does the trick! Thanks.
user=> (enumeration-seq (.entries (java.util.zip.ZipFile. "")))
On Mon, Dec 15, 2008 at 5:14 PM, Rich Hickey wrote:
>
>
>
> On Dec 15, 6:01 pm, "Brian Doyle" wrote:
> > According to the docs the seq function should be able to take an
> > enumerati
On Dec 15, 6:01 pm, "Brian Doyle" wrote:
> According to the docs the seq function should be able to take an
> enumeration,
> but here is what I see:
>
> user=> (seq (.elements (doto (java.util.Vector.) (.add "hello") (.add
> "world"
> java.lang.IllegalArgumentException: Don't know how to cr
According to the docs the seq function should be able to take an
enumeration,
but here is what I see:
user=> (seq (.elements (doto (java.util.Vector.) (.add "hello") (.add
"world"
java.lang.IllegalArgumentException: Don't know how to create ISeq
from: (NO_SOURCE_FILE:0)
SVN 1160, thanks.
--
On Nov 20, 12:37 pm, Feng <[EMAIL PROTECTED]> wrote:
> I start getting StringIndexOutOfBoundException since svn rev 1113 (use
> source name in smap).
Fixed - rev 1120 - thanks for the report.
Rich
--~--~-~--~~~---~--~~
You received this message because you are s
I start getting StringIndexOutOfBoundException since svn rev 1113 (use
source name in smap). Though I'm not sure if this a bug in clojure or
in user code, it appears that SOURCE var always have a root bound
"NO_SOURCE_FILE". Shouldn't below code check against that, instead of
just null?
Index: sr
On Sep 24, 9:33 pm, ".Bill Smith" <[EMAIL PROTECTED]> wrote:
> Try this:
>
> user=> (import '(java.util Map$Entry))
> nil
> user=> Map$Entry
> java.util.Map$Entry
> user=>
Perfect! Thanks!
- James
--~--~-~--~~~---~--~~
You received this message because you are sub
James,
Try this:
user=> (import '(java.util Map$Entry))
nil
user=> Map$Entry
java.util.Map$Entry
user=>
Bill
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to cl
I'm having some problems accessing child classes in the latest release
of Clojure:
user=> (import '(java.util Map))
nil
user=> Map
java.util.Map
user=> Map.Entry
java.lang.ClassNotFoundException: Map.Entry
user=> (import '(java.util.Map Entry))
java.lang.ClassNotFoundException: java.util.Map.Entr
101 - 138 of 138 matches
Mail list logo