CLASSPATH problem on MacOSX

2008-10-28 Thread Chanwoo Yoo
Hi. When I try to use 'contrib' library, next error message occurs. user= (use 'clozure.contrib.duck-streams) java.io.FileNotFoundException: Could not locate Clojure resource on classpath: clozure/contrib/duck_streams/duck_streams.clj My '.profile' file in home directory are as following:

Re: Suggest fcase variant pred-case

2008-10-28 Thread Rich Hickey
On Oct 27, 10:45 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: I used Stuart Sierra's 'fcase' contrib today to good effect. Nice job, Stuart! Yes, I haven't done enough poking around in contrib - fcase looks like a promising candidate for boot.clj. I have an idea for another fcase

troubleshooting classloader problems

2008-10-28 Thread Stuart Halloway
Hi all, When I am troubleshooting classloader problems I find myself wanting to know the list of URLs currently on the classpath. I didn't find this exposed anywhere, so I wrote the functions below. Usage: (take 3 (classpath-url-seq)) -

Re: idiomatic Clojure for agents?

2008-10-28 Thread Stuart Halloway
I have not looked at pmap yet, but I expect it will be a better fit, since Monte Carlo is a good fit for Fork/Join. I am considering using this example across a variety of implementation strategies for the concurrency chapter in the book. Aside from agents and pmap, any other approaches

Re: Suggest fcase variant pred-case

2008-10-28 Thread Stuart Sierra
Hi Stephen, Rich, I haven't had my tea yet either, so I'll look at this some more later. -S On Oct 28, 9:35 am, Rich Hickey [EMAIL PROTECTED] wrote: On Oct 27, 10:45 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: I used Stuart Sierra's 'fcase' contrib today to good effect. Nice job,

Re: genclass error message

2008-10-28 Thread mb
Hi, On 7 Okt., 01:57, Chouser [EMAIL PROTECTED] wrote: Currently if you fail to provide or mis-name the main fn in a gen-class implementation, you get an error like: Exception in thread main java.lang.UnsupportedOperationException: net.n01se/main not defined This is wrong, since the name

Re: Suggest fcase variant pred-case

2008-10-28 Thread Stuart Sierra
On Oct 27, 10:45 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: I used Stuart Sierra's 'fcase' contrib today to good effect. Nice job, Stuart! Thanks! On Oct 28, 9:35 am, Rich Hickey [EMAIL PROTECTED] wrote: If you'd like, I think the effort would be better spent on making a version of

Re: idiomatic Clojure for agents?

2008-10-28 Thread Chouser
On Tue, Oct 28, 2008 at 9:51 AM, Stuart Halloway [EMAIL PROTECTED] wrote: P.S. I think that is the second time you have had to tell me to stop using count as a local name. Bad habits die slowly... :-) Ah, don't worry about it. I'm still catching myself using seq as an argument name.

Re: idiomatic Clojure for agents?

2008-10-28 Thread Stuart Halloway
Hi Bill, Thanks, that's a good point re: await. It would also be interesting to have the agents run for a certain length of time, rather than a certain number of iterations. What do you think of using a map argument to a reduce fn? Idiomatic Clojure seems to prefer using a vector, but I

Re: troubleshooting classloader problems

2008-10-28 Thread Allen Rohner
On Oct 28, 8:48 am, Stuart Halloway [EMAIL PROTECTED] wrote: Hi all, When I am troubleshooting classloader problems I find myself wanting   to know the list of URLs currently on the classpath. I didn't find   this exposed anywhere, so I wrote the functions below. Usage: (take 3

Re: idiomatic Clojure for agents?

2008-10-28 Thread Bill Clementson
Hi Stuart, A lot of parallel processing problems seem to lend themselves to a mapreduce approach. I've written a few blog entries on mapreduce in the past: http://bc.tech.coop/blog/060105.html http://bc.tech.coop/blog/070520.html http://bc.tech.coop/blog/070601.html Bill On Tue, Oct 28, 2008

Re: idiomatic Clojure for agents?

2008-10-28 Thread Stuart Halloway
Java does thread protect, but it is synchronized. Also java.math and java.util's random number generator aren't pluggable with alternate implementations. For that I would need SecureRandom. For my simple example I think I will use a per-thread java.util.Random, note the issues, and point

Patch available: error message for bad prefix list in require/use

2008-10-28 Thread Stephen C. Gilardi
I intended to use a namespace declaration like this: user (ns three-tier (:use clojure.contrib.sql)) nil but I mistakenly typed user (ns three-tier (:use (clojure.contrib.sql))) nil The latter :use call accomplished nothing, but that bit of knowledge is hard

Using a Java Debugger with Clojure

2008-10-28 Thread Peter Wolf
Hello all, I am new to Clojure, but not Java or LISP (I used to work at LMI). I am considering a project written in a mixture of Clojure, Java and Groovy. Clojure for the concurrent inner loop. Groovy/Grails for the Web UI. And lots of Java reused from other projects. How would I debug

Chimp Patch - MacroExpand command

2008-10-28 Thread J. McConnell
For anyone using Meikel Brandmeyer's Chimp plugin for Vim, below is a patch that adds a MacroExpand command, which sends a (macroexpand-1 ...) for the inner s-expr. Hope someone finds it useful. - J. Index: chimp.vim === ---

Re: Using a Java Debugger with Clojure

2008-10-28 Thread Bill Clementson
Hi Peter, On Tue, Oct 28, 2008 at 11:27 AM, Peter Wolf [EMAIL PROTECTED] wrote: Hello all, I am new to Clojure, but not Java or LISP (I used to work at LMI). I am considering a project written in a mixture of Clojure, Java and Groovy. Clojure for the concurrent inner loop. Groovy/Grails

Re: Using a Java Debugger with Clojure

2008-10-28 Thread Scott Hickey
It should work. Before I had a debugging working in Eclipse with Groovy, I used JSwat, JEdit and Ant for project work with success. Scott Hickey Senior Consultant Object Partners, Inc. - Original Message From: Bill Clementson [EMAIL PROTECTED] To: clojure@googlegroups.com Sent:

Newbie question: converting a sequence of map entries into a map

2008-10-28 Thread samppi
I'm new at Clojure, but I'm really liking it, though. I'm having trouble with using map on a map, and turning the resulting sequence of map entries into a new map. In other words, how can you turn this: ([:a 2] [:b 3]) ...into... {:a 2, :b 3}? Thanks in advance.

Re: Newbie question: converting a sequence of map entries into a map

2008-10-28 Thread Matt Moriarity
what you're looking for i believe is into (into {} (list [:a 2] [:b 3])) {:b 3, :a 2} On Oct 28, 3:05 pm, samppi [EMAIL PROTECTED] wrote: I'm new at Clojure, but I'm really liking it, though. I'm having trouble with using map on a map, and turning the resulting sequence of map entries into

commutes do not trigger validate-fn?

2008-10-28 Thread Stuart Halloway
Is this by design? It surprised me, as I expected all transactional updates to be protected by validate-fn. Stuart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Suggest fcase variant pred-case

2008-10-28 Thread Martin DeMello
On Oct 28, 6:35 am, Rich Hickey [EMAIL PROTECTED] wrote: My thoughts are that there should only be fcase PLT Scheme's pattern matching library might be a good source of inspiration: http://download.plt-scheme.org/doc/352/html/mzlib/mzlib-Z-H-31.html#node_chap_31 martin

Re: Chimp Patch - MacroExpand command

2008-10-28 Thread mb
Hi, On 28 Okt., 19:52, J. McConnell [EMAIL PROTECTED] wrote: For anyone using Meikel Brandmeyer's Chimp plugin for Vim, below is a patch that adds a MacroExpand command, which sends a (macroexpand-1 ...) for the inner s-expr. Hope someone finds it useful. Thank you for the patch. I added \me

Re: Chimp Patch - MacroExpand command

2008-10-28 Thread J. McConnell
On Tue, Oct 28, 2008 at 4:44 PM, mb [EMAIL PROTECTED] wrote: I added \me for macroexpand and \m1 for macroexpand-1. Great, thanks Meikel! - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Suggest fcase variant pred-case

2008-10-28 Thread Rich Hickey
On Oct 28, 10:29 am, Stuart Sierra [EMAIL PROTECTED] wrote: On Oct 27, 10:45 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: I used Stuart Sierra's 'fcase' contrib today to good effect. Nice job, Stuart! Thanks! On Oct 28, 9:35 am, Rich Hickey [EMAIL PROTECTED] wrote: If you'd

Re: commutes do not trigger validate-fn?

2008-10-28 Thread Rich Hickey
On Oct 28, 3:32 pm, Stuart Halloway [EMAIL PROTECTED] wrote: Is this by design? It surprised me, as I expected all transactional updates to be protected by validate-fn. Fixed (svn 1085) - thanks for the report! Rich --~--~-~--~~~---~--~~ You received this

Re: Suggest fcase variant pred-case

2008-10-28 Thread Mike Hinchey
On Tue, Oct 28, 2008 at 2:49 PM, Rich Hickey [EMAIL PROTECTED] wrote: On Oct 28, 10:29 am, Stuart Sierra [EMAIL PROTECTED] wrote: I feel like econdp would be less clear, since you don't know what kind of exception should be thrown. Plain old Exception? Or RuntimeError? The kind of error

Re: string interpolation

2008-10-28 Thread Graham Fawcett
On Mon, Oct 27, 2008 at 11:38 PM, Islon [EMAIL PROTECTED] wrote: Is there any chance closure will get string interpolation? Do things like (prn Hi ${someone}, my name is ${myname}) is nice, not crucial of course, but nice. I'm personally not fond of string interpolation either. But for fun,

Re: string interpolation

2008-10-28 Thread Graham Fawcett
On Tue, Oct 28, 2008 at 7:27 PM, Graham Fawcett [EMAIL PROTECTED] wrote: But for fun, here's an (i ...) macro, that will give you ${} interpolation in strings (if it works at all, I test it very thorougly!). Haha, nor did I spell- or grammar-check very thoroughly! I meant: I didn't test the