why not change > < type compare functions do a compare on strings as well?

2010-11-28 Thread Tim Robinson
why not change > < type compare functions do a compare on strings as well? (defn > ([x] true) ([x y](if (string? x) (. clojure.lang.Numbers (isPos (.compareTo x y))) (. clojure.lang.Numbers (gt x y ([x y & more] (if (> x y) (if (next more)

Re: Autodoc dependencies broken?

2010-11-28 Thread Brendan Ribera
I'm seeing related weirdness on a project that has no dependencies except Clojure itself. It'll accept any Clojure from 1.0.0 up, but will default to downloading the newest version: > :dependencies [[org.clojure/clojure "[1.0.0,)"]] The error I get is the same (missing org.clojure:clojure:jar:1.3

Re: Ring startup processing?

2010-11-28 Thread Stuart Campbell
Ah, OK. We just use Tomcat 6 for everything here :) On 29 November 2010 12:16, wrote: > Yep but some app servers have bugs with this interface (GlassFish 2, > jetty 6.1, tomcat 5.5, ...) and the interface is not called appropriately. > There are less problems reported with the load-on-startup fl

Funding 2011?

2010-11-28 Thread Jeremy Dunck
In Dec 2009, Rich asked the community to step up and support core development -- and the community came through. I'm interested in clojure, but not using it professionally yet. I was wondering if funding for 2011 has already been worked out, or if it is an open question? I'd be happy to contribu

Re: Partition At True Values Of Predicate

2010-11-28 Thread Benny Tsai
Hi Asim, Thank you for the code and the explanation of the context. I noticed that partition-after could be implemented by taking my previous code and incrementing all the 'true' indices by one. My first stab: (defn partition-after [pred coll] (if (empty? coll) '() (let [indices (add-

Re: Ring startup processing?

2010-11-28 Thread lprefontaine
Yep but some app servers have bugs with this interface (GlassFish 2, jetty 6.1, tomcat 5.5, ...) and the interface is not called appropriately. There are less problems reported with the load-on-startup flag. Of course if you know your app server's behavior regarding this feature, it might not be

Re: Ring startup processing?

2010-11-28 Thread Stuart Campbell
On 28 November 2010 16:51, wrote: > We use a dedicated servlet for every web app to make sure all prerequisites > are met. Since it's loaded first, we can find problems by looking at a > single > piece of the log files just after the container messages announcing that > it's loading the app. > T

Re: Partition At True Values Of Predicate

2010-11-28 Thread Ken Wesson
On Sun, Nov 28, 2010 at 5:23 PM, Asim Jalis wrote: > On Sun, Nov 28, 2010 at 1:17 PM, Ken Wesson wrote: >> The implementation I posted earlier appears to fit the contract of >> your partition-before (and, additionally, works properly if the input >> starts with (nil ...) :)). > > Good catch :) I

dosync style

2010-11-28 Thread Takahiro Hozumi
Hi, This is trivial question. Which style do you like? (def *counts* (ref {})) (defn dec-or-dissoc! [key] (dosync (let [n (@*counts* key)] (if (< 1 n) (alter *counts* assoc key (dec n)) (alter *counts* dissoc key) (defn dec-or-dissoc! [key] (dosync (alter *counts

Re: Partition At True Values Of Predicate

2010-11-28 Thread Asim Jalis
On Sun, Nov 28, 2010 at 1:17 PM, Ken Wesson wrote: > The implementation I posted earlier appears to fit the contract of > your partition-before (and, additionally, works properly if the input > starts with (nil ...) :)). Good catch :) I should have used (empty? coll) instead of (nil? first-item)

Re: Partition At True Values Of Predicate

2010-11-28 Thread Ken Wesson
The implementation I posted earlier appears to fit the contract of your partition-before (and, additionally, works properly if the input starts with (nil ...) :)). There is another possible variation: partition-dropping. Here the elements for which pred returns true don't get included in the outpu

Re: Why isn't there a fold-right?

2010-11-28 Thread Asim Jalis
This looks like map rather than foldr. On Sun, Nov 28, 2010 at 7:40 AM, tpeng wrote: > i have a one: > (defn lazy-foldr [f coll] >    (lazy-seq >        (if-let [[x & xs] coll] >            (cons x (lazy-foldr f xs) > > it seems works so far ;-p > > On Nov 28, 4:01 pm, Laurent PETIT wrote: >

Re: Partition At True Values Of Predicate

2010-11-28 Thread Asim Jalis
Here is partition-before and partition-after -- partition-after is simpler. (defn partition-before-internal [pred coll] (let [first-item (first coll)] (if (nil? first-item) () (letfn [(get-partial-partition-with-item [] (let [partial-partition (partition-before-internal pr

Re: ANN: Gloss, a byte-format DSL

2010-11-28 Thread Zach Tellman
You're right, that's an omission from the frame syntax. I'll add the ability for all or part of the frame to be scoped as (little- endian ...) and (big-endian ...), with big-endian as the default. Just as a side-note, though, Calx [1] is already handling little- endian data by using encode-to-buf

Re: Partition At True Values Of Predicate

2010-11-28 Thread Asim Jalis
On Sat, Nov 27, 2010 at 5:53 PM, Benny Tsai wrote: > If you don't mind, I would love to see your version with lazy-seq and > recursion. Seems like that's the idiomatic way of solving problems > like this, judging by the source for the partition functions. Hi Benny, Certainly. My solution is app

Re: clojure 1.3 alpha3 and swank

2010-11-28 Thread Michael Ossareh
On Sun, Nov 28, 2010 at 00:15, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > what repository did you get it from? > I don't seem to fine 1.3.0 anywhere.. > > http://clojars.org/swank-clojure I forgot the -SNAPSHOT in my previous message. -- You received this message because you are

Re: ANN: Gloss, a byte-format DSL

2010-11-28 Thread zoka
If Gloss is to decode incoming packet (byte array) in little-endian format it is straightforward: Wrap byte array into ByteBuffer b, invoke b.order(LITTLE_ENDIAN) and pass b to decode function that will return Clojure map of decoded values. However, when outgoing packet byte array is to be produce

Re: Why isn't there a fold-right?

2010-11-28 Thread tpeng
i have a one: (defn lazy-foldr [f coll] (lazy-seq (if-let [[x & xs] coll] (cons x (lazy-foldr f xs) it seems works so far ;-p On Nov 28, 4:01 pm, Laurent PETIT wrote: > Hello, > > clojure is not lazy on evaluation of arguments by default, so I think this > is not poss

Re: Exporting FatJar from Eclipse CCW does not work

2010-11-28 Thread Gijs S.
Hi Alex, Glad to be of help. I had never heard of FatJar before and it turned out to work great for a clojure project I needed to distribute. Also, as a fellow Dutch clojurian I can recommend the Amsterdam Clojurians group at http://ams-clj.github.com. Cheers, Gijs -- You received this message

Re: Clojure benchmark memory use and future improvements (Re: Clojure vs F# performance)

2010-11-28 Thread Alex Osborne
John Fingerhut writes: > Does anyone know a way from within a Java/Clojure program to determine > which GC algorithm is currently in use? I'm curious what the default > is when one is not specified on the command line, and accessing the > one being used from inside of a program would be one good

Re: Clojure benchmark memory use and future improvements (Re: Clojure vs F# performance)

2010-11-28 Thread John Fingerhut
Thanks, Ken. I've changed that in my program now. I've also found that one reason why the Clojure benchmarks on the shootout web site were using so much more memory than the corresponding Java programs (e.g. up to about 350 Mbytes for the fannkuch-redux benchmark program) is a combination of seve

a few helper macros for debugging written for learning macro writing

2010-11-28 Thread Sunil S Nandihalli
Hello everybody, https://gist.github.com/718725 has a few helper macros for debugging which were written to learn macro writing.. so would love to get some feed back Thanks, Sunil. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: a macro to debug the let form

2010-11-28 Thread Sunil S Nandihalli
Hi Robert, What I had posted before was half-baked buggy code .. the following gist has a few more helper debug macros https://gist.github.com/718725 This code was written when I was trying to learn writing macros .. so any criticism is very welcome. Thanks Sunil.

Re: clojure 1.3 alpha3 and swank

2010-11-28 Thread Sunil S Nandihalli
what repository did you get it from? I don't seem to fine 1.3.0 anywhere.. Sunil On Sun, Nov 28, 2010 at 10:24 AM, Michael Ossareh wrote: > I had no issues with swank-clojure 1.3.0: > > in project.clj [swank-clojure "1.3.0"] > > I had plenty of issues using other libraries as there are some brea

Re: Why isn't there a fold-right?

2010-11-28 Thread Laurent PETIT
Hello, clojure is not lazy on evaluation of arguments by default, so I think this is not possible to do this "transparently". Using delay/force could help, but this would not be "transparent" at all for the writer of the fn ;-) 2010/11/27 tpeng > thanks Alex for this nice foldr. ;-) > > howeve