Re: noob : congomongo to disk

2010-06-06 Thread Meikel Brandmeyer
Hi, Am 06.06.2010 um 01:47 schrieb Brian Wolf: java.lang.IllegalArgumentException: No method in multimethod 'print-dup' for dispatch value: class com.mongodb.ObjectId IIRC, this is the _id of the mongo entry. You should contact the author of congomongo. He should add an appropriate

numerator fn

2010-06-06 Thread Dave Pawson
user= (def pie 22/7) #'user/pie user= (class pie) clojure.lang.Ratio user= (numerator pie) java.lang.Exception: Unable to resolve symbol: numerator in this context (NO_SOURCE_FILE:19) Any idea why please? Should return 22?

Re: numerator fn

2010-06-06 Thread Kevin Downey
what version of clojure are you using? On Sun, Jun 6, 2010 at 2:33 AM, Dave Pawson dave.paw...@gmail.com wrote: user= (def pie 22/7) #'user/pie user= (class pie) clojure.lang.Ratio user= (numerator pie) java.lang.Exception: Unable to resolve symbol: numerator in this context

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 10:37, Kevin Downey redc...@gmail.com wrote: what version of clojure are you using? --- Clojure 1.1.0 user= On Sun, Jun 6, 2010 at 2:33 AM, Dave Pawson dave.paw...@gmail.com wrote: user= (def pie 22/7) #'user/pie user=

Re: numerator fn

2010-06-06 Thread Kevin Downey
http://github.com/richhickey/clojure/commit/5293929c99c7e1b1b3bcdea3d451108c5774b3d1 vs. http://github.com/richhickey/clojure/commit/5772be9fc5ac9ddf92b727908c20b9aab971224a On Sun, Jun 6, 2010 at 2:38 AM, Dave Pawson dave.paw...@gmail.com wrote: On 6 June 2010 10:37, Kevin Downey

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 10:48, Kevin Downey redc...@gmail.com wrote: http://github.com/richhickey/clojure/commit/5293929c99c7e1b1b3bcdea3d451108c5774b3d1 vs. http://github.com/richhickey/clojure/commit/5772be9fc5ac9ddf92b727908c20b9aab971224a Have no meaning to me. sorry. -- Dave Pawson XSLT

Re: numerator fn

2010-06-06 Thread Kevin Downey
numerator is added after 1.1.0 was released On Sun, Jun 6, 2010 at 2:58 AM, Dave Pawson dave.paw...@gmail.com wrote: On 6 June 2010 10:48, Kevin Downey redc...@gmail.com wrote: http://github.com/richhickey/clojure/commit/5293929c99c7e1b1b3bcdea3d451108c5774b3d1 vs.

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 11:00, Kevin Downey redc...@gmail.com wrote: numerator is added after 1.1.0 was released Thanks Kevin. documentation ahead of software! Nice change.. if confusing! regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received this message

Recur on a function which uses keyword arguments?

2010-06-06 Thread Jonas Enlund
The function definition below fails with java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 1 args, got: 2 (defn countdown [ {:keys [from] :or {from 10}}] (println from) (when (pos? from) (recur :from (dec from Is it not possible to

Re: numerator fn

2010-06-06 Thread Meikel Brandmeyer
Hi, Am 06.06.2010 um 12:15 schrieb Dave Pawson: On 6 June 2010 11:00, Kevin Downey redc...@gmail.com wrote: numerator is added after 1.1.0 was released Thanks Kevin. documentation ahead of software! Nice change.. if confusing! Note the small branch links on the left hand side:

Re: Recur on a function which uses keyword arguments?

2010-06-06 Thread Nurullah Akkaya
(defn countdown [ {:keys [from] :or {from 10}}] (println from) (when (pos? from) (recur {:from (dec from)}))) Passing {:from (dec from)} instead of :from (dec from) works. Regards... -- Nurullah Akkaya http://nakkaya.com On Sun, Jun 6, 2010 at 2:22 PM,

Re: (apply interleave [[1 2]])

2010-06-06 Thread Eugen Dück
And we could actually also add an no-arg version. My own version of interleave that I use looks like this: (defn interleav ([] nil) ([c] (seq c)) ([c1 c2] (interleave c1 c2)) ([c1 c2 colls] (apply interleave c1 c2 colls))) I guess that's as generic as it gets. Does Rich read all

mapping a collection and a transposed collection of collections

2010-06-06 Thread Eugen Dück
Suppose I have two collections: (def x [1 2]) (def y [[\a \b] [\d \e] [\f \g]]) And want to iterate over them in the following manner: user= (map list x (transpose y)) ((1 (\a \d \f)) (2 (\b \e \g))) Where this is the transpose fn: (defn transpose [in] (partition (count in) (apply

Re: mapping a collection and a transposed collection of collections

2010-06-06 Thread Eugen Dück
P.S. The transpose fn is one of the cases where I'd like to have a more general interleave fn, as lobbied for here: http://groups.google.com/group/clojure/t/c0366933a4333b69 Because with the current version of interleave: user= (transpose [[1 2]]) java.lang.IllegalArgumentException: Wrong number

Re: noob : congomongo to disk

2010-06-06 Thread Brian Wolf
But if print-dup is just seeing clojure.lang.PersistentArrayMap objects, why does it matter what type it contains? On Jun 5, 11:09 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 06.06.2010 um 01:47 schrieb Brian Wolf:      java.lang.IllegalArgumentException: No method in multimethod

Re: noob : congomongo to disk

2010-06-06 Thread Meikel Brandmeyer
Hi, Am 06.06.2010 um 21:46 schrieb Brian Wolf: But if print-dup is just seeing clojure.lang.PersistentArrayMap objects, why does it matter what type it contains? Because the map contents also have to printed, no? This is a recursive process. Sincerely Meikel -- You received this message

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-06 Thread Sean Corfield
On Thu, Jun 3, 2010 at 6:15 PM, Rayne disciplera...@gmail.com wrote: I want to add paste, but I'd terribly hate to have to break tradition with the other trylanguage sites. : Until I read this part of the thread, I hadn't noticed that paste didn't work (since I was highlighting code and

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-06 Thread Sean Corfield
I want to follow up on this and thank Sergey personally for contacting me on IM and working through some debugging with me until he identified Google Analytics as the likely culprit. He removed that and had me try 0.2.1 which worked perfectly! Thanx Sergey! On Mon, May 31, 2010 at 4:33 PM, Sean

Re: noob : congomongo to disk

2010-06-06 Thread Brian Wolf
hmm.. not really 'printing', just trying to save what might be any binary data in a clojure map, as I would save say, want to save gif images in a java or C array. at least that's the analogy I am comparing this case to. So, at least acording to this example, print- dup has to be extended to

Re: noob : congomongo to disk

2010-06-06 Thread Brian Wolf
I'm not sure why it does this anyways, according to congomongo documentation, 'fetch' is supoosed be returning in clojure format, not mongo. On Jun 6, 12:54 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 06.06.2010 um 21:46 schrieb Brian Wolf: But if print-dup is just seeing

interesting problem

2010-06-06 Thread Allan Moore
I have a problem in my program. When I add something to a map, it also seems to get added to a completely different map. I catch the error with an assert on the line immediately following so there isn't much room for my program to do something wrong. The program does quite a bit of processing

Re: interesting problem

2010-06-06 Thread patrik karlin
(dosync (alter local-ref-map1 assoc stuff stuff-struct)) (assert (not (@global-ref-map2 stuff))) so this asserts that the global map dosent hawe something bound to the key of what stuff is refering to. from this code i dont se what the data from link comes from or how its related to the

Re: interesting problem

2010-06-06 Thread patrik karlin
Hey i uploaded a jar http://rapidshare.com/files/396096758/clojure-1.2.0-master-SNAPSHOT.jar.html works 10 times so hurry :D So i cant see whats wrong with your code from that snippet so try it out with 1.2 and if it doesn't work post it on github i am a bit suspicious about it being a bug :p

Re: interesting problem

2010-06-06 Thread Allan Moore
Okay, I have the jar. Thanks very much for posting that for me. I will try it out and let you know what happens. Are you part of the Clojure development team? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: interesting problem

2010-06-06 Thread Allan Moore
Okay, unfortunately with the new jar I am getting an error message when I try to load my code. I type: (load Bugs) and I get: java.lang.ExceptionInInitializerError (bugs.clj:1) The first few lines of bugs.clj are: ; ; Bugs 0.01 ; (use

Re: mapping a collection and a transposed collection of collections

2010-06-06 Thread ataggart
(map list x (apply map list y)) On Jun 6, 5:51 am, Eugen Dück eu...@dueck.org wrote: Suppose I have two collections: (def x [1 2]) (def y [[\a \b] [\d \e] [\f \g]]) And want to iterate over them in the following manner: user= (map list x (transpose y)) ((1 (\a \d \f)) (2 (\b \e \g)))

Re: mapping a collection and a transposed collection of collections

2010-06-06 Thread ataggart
Transposition is commonly done by applying map over the outer collection: user= (vec (apply map vector [[:00 :01][:10 :11]])) [[:00 :10] [:01 :11]] On Jun 6, 5:54 am, Eugen Dück eu...@dueck.org wrote: P.S. The transpose fn is one of the cases where I'd like to have a more general interleave

Re: interesting problem

2010-06-06 Thread ataggart
You can get the latest builds from http://build.clojure.org As for for problem, it is a near certainty that it's not a bug in clojure, and instead something is either alter/assoc'ing stuff onto the map held by global-ref-map2 or something is ref-set'ing local-ref- map1''s map onto

Re: Complex type in clojure

2010-06-06 Thread ataggart
For what it's worth, I think something like 3+5i is perfectly reasonable as the + is not an operation, but part of the notation for a single value, just as the + is not an operation in 1.234e+14. The more troubling concern is whether the imaginary component should be suffixed with an i or a j.

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 13:35, Moritz Ulrich ulrich.mor...@googlemail.com wrote: On Sunday, June 6, 2010, Dave Pawson dave.paw...@gmail.com wrote: On 6 June 2010 11:00, Kevin Downey redc...@gmail.com wrote: numerator is added after 1.1.0 was released Thanks Kevin. documentation ahead of software!