Re: Laziness in filter

2013-03-17 Thread bruce li
gt; http://blog.fogus.**me/2010/01/22/de-chunkifying-**sequences-in-clojure/<http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/>. >> >> On Sunday, March 17, 2013 1:12:17 AM UTC-7, bruce li wrote: >>> >>> Hello, everyone. I'm writing some code that ut

Laziness in filter

2013-03-17 Thread bruce li
20 21 22 23 24 25 26 27 28 29 30 31 and returns: 2 So why the lazy sequence is realized more than it is needed? Could I enforce the laziness and save unnecessary operation? Thanks, Bruce Li -- -- You received this message because you are subscribed to the Google Groups "Clojure" grou

How to ensure consistency when accessing database?

2013-03-06 Thread bruce li
Hello, I'm working on a piece of code that uses congomongo to access mongodb. What I want to implement is to use one collection of the DB as a queue(let's say, it's called "task"). Using congomongo, it's easy to fetch a task that is of status :queue : (def t (fetch-one :task :where {:status :queue

Re: Possible to suppress some stderr output?

2013-03-05 Thread bruce li
hat but it would be the same story for > *out* wouldn't it. Noone redirects System.out when you bind *out* to some > writer, however still it works... > I don't exactly have time to look into this now but I may do this > afternoon :) > > Jim > > > On 05/03/13 15:0

Re: Possible to suppress some stderr output?

2013-03-05 Thread bruce li
*err* writer, but instead use the System/err stream will not get affected. Hope this makes sense. 2013/3/5 Jim - FooBar(); > On 05/03/13 14:50, bruce li wrote: > > What is the difference between *err* and System/err?! > > its the same but wrapped in a PrintWriter > > >

Re: Possible to suppress some stderr output?

2013-03-05 Thread bruce li
e string created by any nested printing > calls." > {:added "1.0"} > [& body] > `(let [s# (new java.io.StringWriter)] > (binding [*out* s# *err* s#] >~@body >(str s# > > Jim > > > > > On 05/03/13 14:33, Jim - Fo

Re: Possible to suppress some stderr output?

2013-03-05 Thread bruce li
up to you what to do with it... :) > > HTH, > Jim > > > On 05/03/13 08:56, bruce li wrote: > >> Hi, guys, >> >> I'm currently playing clojure with android monkey runner. So far it works >> fine but just one unpleasant thing -- the android monkey ru

Possible to suppress some stderr output?

2013-03-05 Thread bruce li
Hi, guys, I'm currently playing clojure with android monkey runner. So far it works fine but just one unpleasant thing -- the android monkey runner default prints a lot of junk information to stderr such as: March 05, 2013 4:46:47 pm com.android.chimpchat.ChimpManager sendMonkeyEventAndGetRespons

Re: A Working nrepl-ritz Setup?

2013-02-23 Thread bruce li
integrate it with ac-nrepl? Or is there any better alternatives? PS. I do miss slime fuzzy complete when I program common lisp though. Also, can nrepl by default make completions on Java methods? I can only find it possible in ac-nrepl. Any help would be appreciated. Bruce Li 2013/1/20 fb &g

Efficient idioms to handle large lists?

2013-01-31 Thread bruce li
ms to slow down a lot when the list grows larger. I'm wondering if in clojure there is some efficient idiom to handle such situation such as efficient concatenation? Thanks, Bruce Li -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Tail call in multi method?

2012-12-19 Thread bruce li
Very helpful. Thanks so much! 2012/12/18 Chas Emerick > On Dec 17, 2012, at 12:39 PM, Ben Wolfson wrote: > > > On Mon, Dec 17, 2012 at 9:32 AM, Chas Emerick wrote: > >> > >> What you're trying to do is really a special case of mutual recursion: > >> because Clojure's methods are separate functi

Tail call in multi method?

2012-12-17 Thread bruce li
Hello, everyone. I'm currently trying to model an automata using multi-method. So in my code, I have something like: (defmethod trans :state [state] ; ... (trans .. In the last line, the trans will be called with some different state. However, it seems that such call

Re: ANN Ritz 0.5.0

2012-10-07 Thread bruce li
2012/10/6 Hugo Duncan > bruce li writes: > > > I'm trying ritz and having some issues with SLDB that really confused > > me. When I switch on the slime-break-on-exception, it seems it sometimes > > doesn't work. The SLDB buffer won't pop up and I some

Re: ANN Ritz 0.5.0

2012-10-05 Thread bruce li
Hello, Hugo. I'm trying ritz and having some issues with SLDB that really confused me. When I switch on the slime-break-on-exception, it seems it sometimes doesn't work. The SLDB buffer won't pop up and I sometimes can see the exceptions in the terminal (but sometimes not :( ). The easiest wa