How to log a precondition in clojure 1.3

2012-03-21 Thread ron peterson
So I'd like to log the AssertionError using clojure.tools.logging library. For example if my function throws the following: # How do I "redirect it" to be printed in the console using the clojure.tools.logging library? Thanks, R. -- You received this message because you are subscribed to the Go

group-by by multiple keys

2012-01-31 Thread ron peterson
hello, How to group a collection of maps by multiple keys? For example (def m1 [{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}{:a 1 :b 4 :c 3}{:a 1 :b 4 :c 3}]) (group-by-x [:a :b] m1) I'd it like to return this: [{:a 1 :b 2}[{:a 1 :b 2 :c 3}{:a 1 :b 2 :c 4}], {:a 1 :b 4}[{:a 1 :b 4 :c 3}{:a 1 :b 4 :c 3}]]

Re: Calling a Java call with array from Clojure

2011-09-13 Thread ron peterson
a String and a > String[]. Use into-array to create a string array, and pass that as > the second arg. > > On Sep 13, 6:21 pm, ron peterson wrote: > > > > > > > > > I have a following API call that I need to make from Clojure: > > > class A > >

Calling a Java call with array from Clojure

2011-09-13 Thread ron peterson
I have a following API call that I need to make from Clojure: class A doSomething(java.lang.String arg1, String... args) so I tried (def a (new A)) ;this works (.doSomething a "abc" "efg" "hij") ;this doesn't work giving me no matching method found: doSomething for class A -- You received

Re: Error running Clojure 1.3 in Eclipse

2011-07-19 Thread ron peterson
from contrib 1.2.0). You might try: > > [org.clojure.contrib/standalone "1.3.0-SNAPSHOT"] > > instead but at this point you might need to start looking at the new > contrib libraries and migrating to those: > > http://dev.clojure.org/display/design/Contrib+Library+

Error running Clojure 1.3 in Eclipse

2011-07-18 Thread ron peterson
I've upgraded my projects in Eclipse 3.7 to use Clojure 1.3 beta1 release, however when I try running it in Eclipse the REPL console throws the following exception. Other versions of Clojure 1.3 alpha gave the same exception: (but clojure 1.2.1 works fine) Warning: *print-detail-on-error* not dec

Re: How to convert a string to a data structure

2011-05-26 Thread ron peterson
Thank you everyone for the solution. Ron. On May 25, 6:24 pm, Luc Prefontaine wrote: > Use: > > (read-string (read-string "[{:a \"blah\" :b 23} {:d 34 :c \"hello\"}]") > > I believe your expression is wrong, (:d should be {:d. > > Luc P. &

How to convert a string to a data structure

2011-05-25 Thread ron peterson
Hi, If I have a following string for example: [{:a "blah" :b 23}(:d 34 :c "hello"}] how can I convert it to a clojure data structure? Thanks, Ron. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Clojureql possilbe bug when using union with constraints

2011-05-18 Thread ron peterson
I'm using the [clojureql "1.0.0"] library. (:require [clojureql.core :as sq]) The following query doesn't generate correct sql: (-> (sq/select (sq/join (sq/table db :tableA)(sq/table db :tableB)(sq/ where (= :tableA.id 27219))) (sq/where (= :tableA.group_id 27202))) (sq/union (sq/select (sq/join