Re: problem with threading and sql lib

2009-09-20 Thread Roger Gilliar
Nothing leaps out at me as a likely cause of a dropped message. - The only reason I can think of: It could be a problem when the loading of the JDBC driver is happening inside a thread. At least that would explain why calling (with-connection db nil ) before

Re: Metadata: something funny

2009-09-20 Thread David Nolen
Hmm, I also note that: (def b #^{:b 2} (quote (1 2 3))) ; ^b - {:line 1} (def b #^{:b 2} (list 1 2 3)) ; ^b - nil On Sun, Sep 20, 2009 at 12:20 PM, samppi rbysam...@gmail.com wrote: I was messing with the REPL when I found this happens: Clojure 1.0.0- user= (def a #^{:a 5} [1 2 3])

Re: Metadata: something funny

2009-09-20 Thread Wilson MacGyver
I just checked against the latest 1.1 snapshot. It returns the same result as you outlined here. On Sun, Sep 20, 2009 at 12:20 PM, samppi rbysam...@gmail.com wrote: I was messing with the REPL when I found this happens: Clojure 1.0.0- user= (def a #^{:a 5} [1 2 3]) #'user/a user= ^a {:a

Re: Metadata: something funny

2009-09-20 Thread Christian Vest Hansen
On Sun, Sep 20, 2009 at 6:20 PM, samppi rbysam...@gmail.com wrote: I was messing with the REPL when I found this happens: Clojure 1.0.0- user= (def a #^{:a 5} [1 2 3]) #'user/a user= ^a {:a 5} user= (def b #^{:b 2} '(1 2 3)) You have a quote symbol in there, so that line can also be

Re: Metadata: something funny

2009-09-20 Thread Christian Vest Hansen
On Sun, Sep 20, 2009 at 7:25 PM, Christian Vest Hansen karmazi...@gmail.com wrote: On Sun, Sep 20, 2009 at 6:20 PM, samppi rbysam...@gmail.com wrote: I was messing with the REPL when I found this happens: Clojure 1.0.0- user= (def a #^{:a 5} [1 2 3]) #'user/a user= ^a {:a 5} user= (def

Re: Silly Convention Question

2009-09-20 Thread Daniel Renfer
I think this further reinforces the need for a clj-lint of sorts. I know I have accidentally declared variables, fns, etc. in both def- derivative forms and in let-style forms that have shadowed a var that was in use somewhere else higher up. It would be handy to have a tool I could run

Q: How to convert a struct-map to xml and back (ignoring functions)?

2009-09-20 Thread MarkSwanson
I would like to encode/decode Clojure structures to/from a database. Parsing XML is easy, but I can't seem to find a simple way to encode Clojure structures to XML and back. Atm my structures are simple: just simple key/value pairs where the key is always a string and the value is always a string

Re: If you wish to have a version for off-line use...

2009-09-20 Thread MarkSwanson
Personally, that's not what I want. I want to download the clojure.org web page - one level deep so the files api, special_forms, macros, etc. are all available on my laptop offline. I tried a couple of programs (wget and httrack) to get this but there is some strange combobulation of redirects

Re: Q: How to convert a struct-map to xml and back (ignoring functions)?

2009-09-20 Thread Timothy Pratley
I've found clojure-contrib/prxml to be very useful http://richhickey.github.com/clojure-contrib/prxml-api.html On Sep 21, 8:32 am, MarkSwanson mark.swanson...@gmail.com wrote: I would like to encode/decode Clojure structures to/from a database. Parsing XML is easy, but I can't seem to find a

Re: Metadata: something funny

2009-09-20 Thread samppi
That's perfect. Thanks a lot, everyone. On Sep 20, 11:35 am, Jarkko Oranen chous...@gmail.com wrote: (def b #^{:b 2} (quote (1 2 3))) ... and #^{} applies read-time to the following *form* rather than the value they evaluate to, so that is why neither (list ...) nor (quote ...) work.

Re: Can anyone here give a comparison between Clojure and Erlang on concurrent programming?

2009-09-20 Thread dongbo
A million thanks to you guys! To ss: concise and clear. very helpful! To Wojtek: very detailed, I'll bear your suggestion in my mind! Thanks a lot To Timothy: thanks for sharing! -dongbo --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: If you wish to have a version for off-line use...

2009-09-20 Thread Adrian Cuthbertson
Generally I use the source code for clojure and contrib documentation. I open an instance of Jedit on the source directory and use it's search/grep facilities to find what I'm looking for. It also helps in familiarising with the clojure and contrib implementations and learning the techniques

exception: agents + swing

2009-09-20 Thread Raoul Duke
hi, i don't have a repro case yet, but i've been trying to use agents to be able to get swing's thread to draw things from my engine w/out having to think hard about threading; using @agent in my swing-related code to get the state of things to be drawn. but sometimes i get an error on a source

Q: how to solve this concurrency problem ?

2009-09-20 Thread Roger Gilliar
Hi, im not sure how to solve the following problem: (defn parse [outstream-agent xml] (let [content (clojure.xml/parse (ByteArrayInputStream. (. xml getBytes))) first-element (:tag content) ] (try (if @*is-syncing*