Re: possible bug in `case'

2011-01-07 Thread Alex Osborne
"Eric Schulte" writes: > Hi, > > The following case statement > > #+begin_src clojure > (defn buggy-case [n] > (case (int n) > 0 :null > 1 :load > 0x7000 :loproc)) > #+end_src > > throws the following error > > No distinct

Re: possible bug in `case'

2011-01-07 Thread Stuart Halloway
This is on the release roadmap for 1.3: http://dev.clojure.org/jira/browse/CLJ-426. Volunteers welcome! Stu > Hi, > > The following case statement > > #+begin_src clojure >(defn buggy-case [n] > (case (int n) >0 :null >1 :load >0

Re: ANN: ClojureQL 1.0.0 now released

2011-01-07 Thread LauJensen
Hi Sean, Half right - It will compile everytime, but not necessary create the AST everytime: (let [my-table (-> (table :user) (select (where (= :id user-id))) (project [:dateofbirth :gender :zipcode]))] (repeatedly @my-table)) However I see there are some good thoughts on optimization

Re: What am I not getting here?

2011-01-07 Thread new2clojure
Thank you all for your help, I appreciate it very much. I come from the world of OO programming and I am bending my head backwards to try to think in the functional paradigm. Bellow you will find my version of Peter Norvig's spell checker (http://norvig.com/spell-correct.html) in clojure, followe

Re: What am I not getting here?

2011-01-07 Thread Baishampayan Ghose
> Bellow you will find my version of Peter Norvig's spell checker > (http://norvig.com/spell-correct.html) in clojure, followed by the > java version. I coded the later first and then I attempted to > "translate" it. In a few months time I will try to implement it again > from scratch (in clojure)

Midje 0.9 released #testing

2011-01-07 Thread Brian Marick
Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing. The 0.9 release mainly provides useful checkers for "collection-like things" (collections and strings). Checkers are single-argument functi

Clojure job scheduler

2011-01-07 Thread Trevor
What's the best way to kick off Clojure code at scheduled times? I have some that would run once a day. Some that might run 2 or 3 times a day based upon a test being met. 1. I could write a function that sleeps an interval, check the time differential to perform a time-box triggered function, but

Re: Boston meetup Jan 11?

2011-01-07 Thread Eric Kobrin
Jeff posted this in a separate thread. We'll be hosting a meetup on the 13th: 1st Boston Clojure Meetup Date: Thursday, January 13th, 2011 Location: Akamai Technologies 8 Cambridge Center Conference Room 200D Cambridge, MA 02142 (Corner of Broadway and Galileo Galilei) Akamai Technologies wil

Re: Clojure job scheduler

2011-01-07 Thread gaz jones
the work library has a function which it describes as 'cron for clojure functions': https://github.com/clj-sys/work.git cant say i have used it, but i noticed it in there recently whilst looking for other things. here is the function: (defn schedule-work "schedules work. cron for clojure fns.

Re: ANN: ClojureQL 1.0.0 now released

2011-01-07 Thread Feng
I'd suggest ClojureQL only optimize lisp form to SQL text transformation, and provide options whether to use PreparedStatement or not. Leave other kind of optimizations to databases/drivers. Some thoughts below: - PreparedStatement avoids high cost of frequent query planning (oracle call it hard

Re: ANN: ClojureQL 1.0.0 now released

2011-01-07 Thread Rick Mouritzen
A prepared statement is something inside a database. The true object isn't part of JDBC or a JDBC driver. So you open a connection, then create your SQL using JDBC's PreparedStatement to tell the DB to use a prepared statement. Next time that same SQL is used with another JDBC PreparedStatement, t

REPL+Laziness: the worst combination ever!

2011-01-07 Thread Nicolas Buduroi
I've been doing a lot of Clojure lately and, of all thing, collection's laziness coupled with a REPL is what makes me loose the most time. I really love having laziness built-in by default and I'm a REPL-driven development addict, but sometimes I just loose minutes (if not hours) chasing imaginary

Re: ANN: ClojureQL 1.0.0 now released

2011-01-07 Thread Feng
On Jan 7, 7:36 pm, Rick Mouritzen wrote: > A prepared statement is something inside a database. The true object > isn't part of JDBC or a JDBC driver. Some JDBC drivers and JEE Datasources (all Oracle and IBM products) do cache stmt per connection (i.e. stmt.close() doesn't really close it, jus

distributeted computing newby, clojure ...

2011-01-07 Thread Nick Zbinden
Hallo, I would like to talk about two things. General: I have a small project that has really easy to paralyzable problem so I think that a good place to start with parallel programming. Doning it on one pc is simple in clojure. So I tought to myself: You can distribute that. I have never done a

Re: Midje 0.9 released #testing

2011-01-07 Thread Alex Baranosky
Thanks Brian, I for one love Midje. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe

Re: ANN: ClojureQL 1.0.0 now released

2011-01-07 Thread Sean Corfield
On Fri, Jan 7, 2011 at 3:23 AM, LauJensen wrote: > Half right - It will compile everytime, but not necessary create the > AST everytime: > > (let [my-table (-> (table :user) >    (select (where (= :id user-id))) >    (project [:dateofbirth :gender :zipcode]))] >  (repeatedly @my-table)) Interesti

Re: Clojure job scheduler

2011-01-07 Thread Michael Gardner
On Jan 7, 2011, at 11:13 AM, Trevor wrote: > 3. I could set a job-schedule using the OS to run a clojure script. > I'd rather not, I would like to do things like send emails / check > status via web app (making option 1 more appealing). Could you elaborate on why a scheduled job to run a Clojure

Re: Clojure job scheduler

2011-01-07 Thread Ken Wesson
On Fri, Jan 7, 2011 at 9:35 PM, Michael Gardner wrote: > On Jan 7, 2011, at 11:13 AM, Trevor wrote: > >> 3. I could set a job-schedule using the OS to run a clojure script. >> I'd rather not, I would like to do things like send emails / check >> status via web app (making option 1 more appealing).

Re: REPL+Laziness: the worst combination ever!

2011-01-07 Thread Alan
I do this too on occasion, and my opinion is: better to chase them in the REPL than in deployed code, because the same problem would usually come up there. On Jan 7, 5:03 pm, Nicolas Buduroi wrote: > I've been doing a lot of Clojure lately and, of all thing, > collection's laziness coupled with a

Re: Clojure job scheduler

2011-01-07 Thread Michael Gardner
On Jan 7, 2011, at 9:19 PM, Ken Wesson wrote: > On the other hand, running a job scheduler from outside Clojure > results in cranking up a big, slow to start up, expensive JVM process > every single time a task needs to run, each of which runs one task > once, and the scheduling itself must be don