Re: Protocol question: donating code to clojure-contrib

2009-07-22 Thread Howard Lewis Ship
In my repo I've created a clojure.contrib.re for regular expression oriented functions. On Tue, Jul 21, 2009 at 7:14 PM, Chouserchou...@gmail.com wrote: On Tue, Jul 21, 2009 at 7:24 PM, Howard Lewis Shiphls...@gmail.com wrote: I have some useful code related to regular expression parsing

Re: Logging functions delegated to java logging systems

2009-07-22 Thread Timothy Pratley
Hi Alex, You've got my vote - logging is essential for non-trivial programs. Your implementation is superior to mine, but maybe you would like to include some sub-parts: http://github.com/timothypratley/strive/blob/baf83e2bb26662f5f5049d165dec31e47b91e171/clj/timothypratley/logging.clj

Re: Bitfields access in Clojure

2009-07-22 Thread Timothy Pratley
Could you give a more detailed example to illustrate what this means?   (with-bitfields arr 0 {last 1, term 1, dest 22, char 8}     [last term dest char]) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

Re: Ant build.xml snippet: compile

2009-07-22 Thread Michael Wood
2009/7/22 Howard Lewis Ship hls...@gmail.com: On Tue, Jul 21, 2009 at 3:17 PM, Laurent PETITlaurent.pe...@gmail.com wrote: Hi, so far my examples were more based on issues with namespaces separated into multiple pieces than on a namespace / script dichotomy. So while I understand the

Re: Ant build.xml snippet: compile

2009-07-22 Thread Laurent PETIT
2009/7/22 Michael Wood esiot...@gmail.com 2009/7/22 Howard Lewis Ship hls...@gmail.com: On Tue, Jul 21, 2009 at 3:17 PM, Laurent PETITlaurent.pe...@gmail.com wrote: Hi, so far my examples were more based on issues with namespaces separated into multiple pieces than on a namespace

Re: thread-pool scope

2009-07-22 Thread Dan Fichter
Thanks very much for the reply. I've considered creating namespaces on the fly and interning vars in them for each thread pool. Thread-local binding that follows the stack discipline is a beautiful concept (if I call you, accept and pass on my bindings), and thread-pool binding seemed like it

Re: Clojure as a CGI language?

2009-07-22 Thread robert hickman
Trying to use CGI sounds like a bad idea. It's always full of security issues I have read trough the page that you linked to and the issues listed ain't any different from the issues associated with developing PHP applications. I mostly agree with the above, just to extend it a

London Clojurians

2009-07-22 Thread Alex Scordellis
After the successful coding dojo held on Monday night [1], I've created a group for London Clojurians who want to get together to organise events, share learnings etc. It's at http://groups.google.com/group/london-clojurians Currently google thinks that the group is spam and won't let me post a

Re: Bitfields access in Clojure

2009-07-22 Thread Daniel Janus
On 22 Lip, 09:52, Timothy Pratley timothyprat...@gmail.com wrote: Could you give a more detailed example to illustrate what this means?   (with-bitfields arr 0 {last 1, term 1, dest 22, char 8}     [last term dest char]) Perhaps a good illustration will be what it macroexpands to: (let

Re: Protocol question: donating code to clojure-contrib

2009-07-22 Thread Howard Lewis Ship
Wow! I thought being on GitHub would mean that it wouldn't be necessary to send patches via e-mail. On Tue, Jul 21, 2009 at 11:29 PM, Howard Lewis Shiphls...@gmail.com wrote: In my repo I've created a clojure.contrib.re for regular expression oriented functions. Wow On Tue, Jul 21, 2009 at

Re: Protocol question: donating code to clojure-contrib

2009-07-22 Thread Meikel Brandmeyer
Hi, On Jul 22, 2:31 pm, Howard Lewis Ship hls...@gmail.com wrote: Wow!  I thought being on GitHub would mean that it wouldn't be necessary to send patches via e-mail. (Disclaimer: Personal opinion following...) Pull requests are not a good device for open contribution. They require a lot of

Re: Clojure as a CGI language?

2009-07-22 Thread Daniel Renfer
On Wed, Jul 22, 2009 at 3:36 AM, robert hickmanrobert.e.hick...@googlemail.com wrote: If you want very easy to deploy web apps,  I would suggest Compojure: http://github.com/weavejester/compojure/tree/master You can always use a proxy to front a compojure app, which is how a

Re: predicates in Programming Clojure

2009-07-22 Thread Jimmie Houchin
Meikel Brandmeyer wrote: Hi, Am 21.07.2009 um 22:48 schrieb Jimmie Houchin: (defn is-small? [number] (if ( number 100) yes no )) Is is-small? a predicate? If so, is this a common pattern for such predicates? The definition is correct. is-small? is not a predicate. It returns

Re: Clojure as a CGI language?

2009-07-22 Thread Chouser
On Wed, Jul 22, 2009 at 3:36 AM, robert hickmanrobert.e.hick...@googlemail.com wrote: You could use FastCGI to accomplish this, though you would have to write the interface. http://www.fastcgi.com/ FastCGI would remove the long startup times for the JVM, etc. I will

Re: Can (genclass) be changed to operate when not compiling?

2009-07-22 Thread Stuart Sierra
On Jul 21, 6:55 pm, Howard Lewis Ship hls...@gmail.com wrote: It would be nice if (gen-class), when not in compile mode, would still create a class in memory that could be referenced by class name elsewhere in Clojure. The gen-class function does nothing unless the *compile-files* var is

Request for Assembla membership (hlship)

2009-07-22 Thread Howard Lewis Ship
I have a code contribution for clojure-contrib; please bump me up to member so I can create my ticket and attach my patch. Thanks! -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos --~--~-~--~~~---~--~~ You

Re: Can (genclass) be changed to operate when not compiling?

2009-07-22 Thread Howard Lewis Ship
On Wed, Jul 22, 2009 at 8:16 AM, Stuart Sierrathe.stuart.sie...@gmail.com wrote: On Jul 21, 6:55 pm, Howard Lewis Ship hls...@gmail.com wrote: It would be nice if (gen-class), when not in compile mode, would still create a class in memory that could be referenced by class name elsewhere in

Re: Clojure as a CGI language?

2009-07-22 Thread Mike Hinchey
As Daniel mentioned, Google App Engine can host java. It's very easy, just upload a war with your clj AOT-compiled. See http://elhumidor.blogspot.com/2009/04/clojure-on-google-appengine.html -Mike --~--~-~--~~~---~--~~ You received this message because you are

Re: Bitfields access in Clojure

2009-07-22 Thread Paul Mooser
Is it safe to assume that you can extract the key ordering from the literal map the user specified ? Or am I misunderstanding ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

Re: Logging functions delegated to java logging systems

2009-07-22 Thread Tom Faulhaber
Yeah, I'd like to see something like this in clojure-contrib. One of the problems that java systems routinely have is mismatches between the assumed logging system. This is a real pain when it comes up and it would be nice to have that taken care of by an abstraction layer. Tom On Jul 21, 10:13 

Re: predicates in Programming Clojure

2009-07-22 Thread Richard Newman
That is what I thought. Is it proper or idiomatic Clojure to use a ? symbol on non-predicate functions? I don't think so. The standard library doesn't, at any rate. Note that predicates don't necessarily have to return literal true or false: in my opinion at least, it's perfectly reasonable

Approaching Clojure-Hibernate integration using hibernate.default_entity_mode = dynamic-map (Feedback Request)

2009-07-22 Thread Shantanu Kumar
Hi, (I am cross-posting this on Clojure and Hibernate-users mailing list.) DISCLAIMER: I am a Clojure newbie - please let me know if you find any of my assumptions / statements to be incorrect. Hibernate has an experimental support for working with maps rather than POJOs using the following

Re: Can (genclass) be changed to operate when not compiling?

2009-07-22 Thread Dragan Djuric
Howard, Is there a chance that you consider making Cascade servlet- independent? It would be great if Cascade application could be also run, for example, directly as a grizzlet (or some other yet-to-be- created technology). Is there an absolute need to depend on servlets now when we have

Re: Ant build.xml snippet: compile

2009-07-22 Thread Christopher Wilson
Sorry if this is a bit OT, but has anyone created an ant or maven jar task (maven: is 'goal' the correct term)? In the few jars that I've created I've AOT compiled my .clj files and hand-created the jar file. The way that I do this is compile to the default clojure classes directory, I then pull

Re: Logging functions delegated to java logging systems

2009-07-22 Thread ataggart
Tim, you're too modest. I'm incorporating some of your stuff now. I'll update once it's done. On Jul 22, 12:04 am, Timothy Pratley timothyprat...@gmail.com wrote: Hi Alex, You've got my vote - logging is essential for non-trivial programs. Your implementation is superior to mine, but

Re: Bitfields access in Clojure

2009-07-22 Thread Meikel Brandmeyer
Hi, Am 22.07.2009 um 18:42 schrieb Paul Mooser: Is it safe to assume that you can extract the key ordering from the literal map the user specified ? Or am I misunderstanding ? Up to eight elements in a literal map are stored as array-map. An array-map keeps the key ordering. For more

Re: predicates in Programming Clojure

2009-07-22 Thread Meikel Brandmeyer
Hi, Am 22.07.2009 um 19:35 schrieb Richard Newman: Note that predicates don't necessarily have to return literal true or false: in my opinion at least, it's perfectly reasonable to write (def my-predicate? #{:foo :bar}) -- it'll behave correctly in if and when, but the return value will

Confusion with apply.

2009-07-22 Thread mmwaikar
Hi, I am getting a little confused in how apply works. I thought that (apply f args* argseq) means applying f to each of the elements of argseq one by one (assuming one doesn't pass any args), but it is not like that. So for ex, I wrote this: (defn mul5 [arg] (* arg 5)) and wanted to do this:

Re: Confusion with apply.

2009-07-22 Thread Laurent PETIT
You are searching map. You should definitely consider reading the datastructures and sequences pages on clojure.org, or you will be stopped at each step. Regards, -- Laurent 2009/7/22 mmwaikar mmwai...@gmail.com Hi, I am getting a little confused in how apply works. I thought that

Re: Confusion with apply.

2009-07-22 Thread mmwaikar
Thanks Laurent. I read about map, but I didn't think of using it because map takes a source collection coll and a function f, and it returns a new sequence by invoking f on each element in the coll and in my situation, I don't want a new collection back. So for ex, a have a list of file names

Re: Confusion with apply.

2009-07-22 Thread Richard Newman
I would like this move to be applied to each file in the list. If you don't want a sequence back -- probably because you only want the side-effects -- you should look at doseq. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

New Lisp book involving Clojure

2009-07-22 Thread rob
FYI, The latest post on Planet Lisp discussing Nick Levine's upcoming book Lisp outside the Box (to be published by O'Reilly from what I understand) mentions it will involves some words on interaction between CL and Clojure. http://enlivend.livejournal.com/12770.html

Re: Ant build.xml snippet: compile

2009-07-22 Thread Daniel Renfer
On Wed, Jul 22, 2009 at 2:46 PM, Christopher Wilsonchristopher.j.wil...@gmail.com wrote: Sorry if this is a bit OT, but has anyone created an ant or maven jar task (maven: is 'goal' the correct term)? In the few jars that I've created I've AOT compiled my .clj files and hand-created the jar

read-line in emacs slime on windows problem

2009-07-22 Thread Kelvin Ward
I've been using EmacsW32 with SLIME. Whenever I call (read-line) in the REPL it never completes reading the input. This problem does not happen when using the command line to launch the clojure REPL. I've tried combinations of clojure1.0.0.jar the 1.1 alpha snapshot, the latest

Multimethods dispatching - performance for larger taxonomies

2009-07-22 Thread Dragan Djuric
I've just read in the Stuart's book that multimethod dispatching on something other than Java inheritance is rarely used. It seems to me that there is a huge potential for their use in something that I do, so I'd add yet to his words. Anyway, what I would ask someone from the core team, or

Re: Confusion with apply.

2009-07-22 Thread John Harrop
On Wed, Jul 22, 2009 at 5:17 PM, mmwaikar mmwai...@gmail.com wrote: So if this is the intended behavior of apply, which function should I use in this case? Is there anything in Clojure where I can apply any user-defined function to each and every element of a list one-by-one? Use map: user=

Re: Clojure as a CGI language?

2009-07-22 Thread robert hickman
2009/7/22 Mike Hinchey hinche...@gmail.com: As Daniel mentioned, Google App Engine can host java.  It's very easy, just upload a war with your clj AOT-compiled. The google app engine looks like an interesting platform, However I cannot create an account as I don't have a phone.

Re: Clojure as a CGI language?

2009-07-22 Thread Niels Mayer
On Wed, Jul 22, 2009 at 8:58 AM, Mike Hinchey hinche...@gmail.com wrote: As Daniel mentioned, Google App Engine can host java. It's very easy, just upload a war with your clj AOT-compiled. See http://elhumidor.blogspot.com/2009/04/clojure-on-google-appengine.html Very interesting! It also

classloading / proxy / JMX issue

2009-07-22 Thread Stuart Halloway
I have a failing test in the JMX server code [1]: (deftest dynamic-mbean (let [mbean-name clojure.contrib.test_contrib.test_jmx:name=Foo] (jmx/register-mbean (jmx/dynamic-mbean (ref {:string-attribute a-string})) mbean-name) (is (= a-string (jmx/read mbean-name

Re: Multimethods dispatching - performance for larger taxonomies

2009-07-22 Thread Stuart Halloway
I certainly agree with the addition of yet. I am finding multimethods to be more and more useful every day. I am now covering keyword inheritance during *intro* talks on Clojure. Stuart I've just read in the Stuart's book that multimethod dispatching on something other than Java

Memory Problem

2009-07-22 Thread sailormoo...@gmail.com
Hi : I would like to know why ( from http://stackoverflow.com/questions/749911/how-can-i-leak-memory-in-clojure ) (drop 90 (vec (range 100))) would cause memory problem in clojure and how to fix it? Thanks Because I think my code might have similar problem of memory cannot

Re: predicates in Programming Clojure

2009-07-22 Thread Stuart Halloway
The question mark suffix should be used only for predicates. The author of the erroneous prose is currently being forced to drink an extra glass of wine before bed as punishment. I have *no* idea why I wrote that -- best guess is that is-small? started as a predicate and was later changed

Sweeping Networks with Clojure

2009-07-22 Thread tmountain
I've written a short blog post on using Clojure to search for available ssh servers on my companies VPN. It starts with a single- threaded example and then adds concurrency. The performance difference in this case was pretty extreme. Sweeping 254 hosts in a serial single- threaded fashion took

Re: Memory Problem

2009-07-22 Thread Stuart Halloway
The call to vec isn't lazy (and makes no sense in the example). Remove the call to vec and the remaining calls to drop and range are lazy. You will probably also want to (set! *print-length* 10) or some such at the REPL. Cheers, Stu Hi : I would like to know why ( from

Re: Memory Problem

2009-07-22 Thread sailormoo...@gmail.com
Oh I see, Thanks.., but how to I check if a function is lazy or not? --~--~-~--~~~---~--~~ 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