Re: *assert* and assert

2010-10-22 Thread Shantanu Kumar
On Oct 22, 10:59 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, On 22 Okt., 07:48, Shantanu Kumar kumar.shant...@gmail.com wrote: When I runs this using Clojure 1.2.0: (binding [*assert* false] (assert false)) I get java.lang.AssertionError: Assert failed: false Can somebody

Re: Help to optimize palindrome search from input file

2010-10-22 Thread siddarth shankar
very nice! faster and more succinct :) also means we can read in smaller chunks from large strings as required.. On Oct 21, 4:15 am, Kent squi...@aol.com wrote: I took a different approach, not wildly clojurish, type-hinted, ugly, but also pretty fast.  About 1.2ms on my machine (after about 10

Setting Clojure “constants” at runtime (crosspos ted to Stackoverflow)

2010-10-22 Thread Ralph
I have a Clojure program that I build as a JAR file using Maven. Embedded in the JAR Manifest is a build-version number, including the build timestamp. I can easily read this at runtime from the JAR Manifest using the following code: (defn set-version Set the version variable to the build

Re: Setting Clojure “constants” at runtime (cros sposted to Stackoverflow)

2010-10-22 Thread James Reeves
Is there a reason why you can't (def version ...) directly, without calling it via a set-version function? - James On 22 October 2010 16:56, Ralph grkunt...@gmail.com wrote: I have a Clojure program that I build as a JAR file using Maven. Embedded in the JAR Manifest is a build-version number,

Re: Setting Clojure “constants” at runtime (cros sposted to Stackoverflow)

2010-10-22 Thread Ralph
Yes. I does not work. The def gets evaluated at compile-time, not run-time. The JAR file that the code is reading does not exist until after the program is compiled. On Oct 22, 12:28 pm, James Reeves jree...@weavejester.com wrote: Is there a reason why you can't (def version ...) directly,

Reference Menu sans Transients

2010-10-22 Thread cej38
Before I make a slight criticism, let me state, that clojure.org web pages are by far the best reference pages I have seen on any language. That being said, the Reference bar on the left-hand-side of the page, appears to be out of date. I believe that there should also be a link for

Re: Setting Clojure “constants” at runtime (cros sposted to Stackoverflow)

2010-10-22 Thread ataggart
(defn get-version [] (- (str jar: (- my.ns.name (.getProtectionDomain) (.getCodeSource) (.getLocation)) !/META-INF/MANIFEST.MF) (URL.) (.openStream) (Manifest.) (.. getMainAttributes)

Re: Improving Contrib

2010-10-22 Thread Sean Corfield
On Tue, Oct 19, 2010 at 10:53 PM, Chas Emerick cemer...@snowtide.com wrote: I suggested in the channel sometime last month that a Lodge your CA here table should be set up at the Conj.  Anyone know if that's a go or not?  IMO, no one should leave on Saturday without being settled in this

Re: Improving Contrib

2010-10-22 Thread Ulises
I know this may be a silly question but: how does one get started helping with contrib/etc.? I'm only starting to learn clojure but I've found the community so helpful and thriving that I cannot help but to want to help ... what is the first step? U -- You received this message because you are

Strange behavior of PersistentTreeMap

2010-10-22 Thread andrei
My purpose is to write function for replacing multiple substrings in a string. Here's my approach: (defn replace-map Replaces substrings in s from (keys m) by (vals m). [s m] (loop [cur-str s, rps m] (if (empty? rps) cur-str (recur (.replace s (first (first rps)) (second