Re: core cache/memoize issue?

2012-07-13 Thread siyu798
Awesome, thx a lot!! On Wednesday, July 11, 2012 7:24:29 PM UTC-4, Fogus wrote: Thank you for the report. I have a fix for the LRU/LU caches on my box and will have it out in the next day or so. The core.memoize changes will follow soon after. -- You received this message because you

leiningen: how to set compiled classes outputdir

2011-10-21 Thread siyu798
Hi, I'm trying to set the classes output path different from the default src/main/classes by overriding :javac-options {:destdir ../../target/classes/} and that does not seem to work. is there a property I can use to accomplish this? Thanks, Siyu -- You received this message because you

Re: leiningen: how to set compiled classes outputdir

2011-10-21 Thread siyu798
I tried :compile-path and it worked, but it's not listed in https://github.com/technomancy/leiningen/blob/stable/sample.project.clj -- 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

Re: iterate with side-effect function?

2011-09-28 Thread siyu798
Odyssomay, While does not work in this case as ctx will be updated on each iteration and fed to the next iteration. Thanks, siyu -- 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

Re: iterate with side-effect function?

2011-09-28 Thread siyu798
Thanks everyone. -- 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 from this group,

iterate with side-effect function?

2011-09-27 Thread siyu798
Hi, From clojure doc, it states iterate takes a side-effect free function, and what's the implication if the function has side-effect as follow? (- 0 (iterate (fn [cnt] (prn cnt) ;; save data to csv (Thread/sleep 6000) (inc

Re: iterate with side-effect function?

2011-09-27 Thread siyu798
Nathan, Thanks for the explanation, what i'm trying to do is to repeatedly run a side-effect function until the return value of it meets certain criteria. It could have been done using loop/recur as shown below, and wondering if there's alternatives. Is a there general approach to

Parsing double with default value

2011-07-25 Thread siyu798
Hi, Is there an idiomatic/built-in way to parse double with a default value if there's exception? Currently we use a generic with-default macro to ignore exception and return default value as follow: (with-default 0.0 (Double. my-value)) -- You received this message because you are

Re: Parsing double with default value

2011-07-25 Thread siyu798
Tassilo, The reason a generic default macro being used here is because we can use the same macro to parse other data type like integer: (with-default 1 (Integer. my-value)) Thanks, siyu -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Parsing double with default value

2011-07-25 Thread siyu798
Alan, Your with-default fn is neat. So it appears there's no idiomatic/built-in clojure fn/macro to do parsing and wrapper functions such as follow would be needed to avoid typing the whole expression every time. (def parse-double (with-default #(Double. %) 0.0)) (def parse-int

update xml attribute value

2011-06-02 Thread siyu798
Hi, Does anyone know how to update xml element attribute value on the zipper data structure? I have something like root element1 name=x1 description=d1/ element2 name=x2 description=d2/ /root (:require (clojure [xml :as xml] [zip :as zip]) [clojure.contrib.zip-filter.xml :as

Re: update xml attribute value

2011-06-02 Thread siyu798
Thanks Allen, it works, I did not know the loc can be treated like a hash. siyu -- 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

Re: A simulation of the Monty Hall Problem

2011-05-19 Thread siyu798
Hi, I started learning clojure for a few months and this is what I have for the problem, and I find it running very slow if exceeding 100k trials, maybe it's because of using set? Any feedbacks will be appreciated. thx (require '[clojure.set :as set]) (def doors #{:a :b :c}) (defn rand-nth-set

Re: A simulation of the Monty Hall Problem

2011-05-19 Thread siyu798
On Thursday, May 19, 2011 4:38:17 PM UTC-4, Ken Wesson wrote: On Thu, May 19, 2011 at 12:52 PM, siyu798 siy...@gmail.com wrote: Hi, I started learning clojure for a few months and this is what I have for the problem, and I find it running very slow if exceeding 100k trials, maybe

Re: A simulation of the Monty Hall Problem

2011-05-19 Thread siyu798
On Thursday, May 19, 2011 6:36:34 PM UTC-4, Ken Wesson wrote: On Thu, May 19, 2011 at 6:16 PM, siyu798 siy...@gmail.com wrote: On Thursday, May 19, 2011 4:38:17 PM UTC-4, Ken Wesson wrote: On Thu, May 19, 2011 at 12:52 PM, siyu798 siy...@gmail.com wrote: (set

Re: [ANN] fs - file system utilities for Clojure

2011-03-22 Thread siyu798
Miki, We do have functions to normalize and convert path and I just think the dirname function should not do the conversion. In fact there's no benefits to do so as /a/b/c on *nix is not equal to \a\b\c in window, same goes for c:\a\b\c in window for c:/a/b/c in *nix. In 99.99% percent of

Re: [ANN] fs - file system utilities for Clojure

2011-03-21 Thread siyu798
Miki, Thanks for the quick response, but I'm not just looking for a fix for the testcase, I'm looking for the dirname function to return the same output regardless of the machine that the code is running on, eg (dirname /a/b/c) should return /a/b/ on both win and unix just like the

Re: [ANN] fs - file system utilities for Clojure

2011-03-18 Thread siyu798
Hi Miki, The dirname testcase fails on Window. Does it make sense that even if it's running on window it should still pass? In another word, don't you think that it should not convert the separator implicitly? (deftest dirname-test (is (= (dirname /a/b/c) /a/b))) user= (fs/dirname

Re: [ANN] fs - file system utilities for Clojure

2011-03-15 Thread siyu798
Hi Miki, We are planning to use this file system utilities, and we need a function to get file extension. Currently we're using apache common for that, but we want to get rid of apache common altogether. Can you add this functionality to the fs.clj? Thx Si Yu -- You received this message