Re: Clojure quickstart maven archetype

2009-09-09 Thread Fredrik Appelberg
On Tue, Sep 8, 2009 at 4:09 AM, Scott Fleckenstein wrote: > > On another note, it's surprising given that how easy creating the > archetype was how incredibly arcane writing a plugin is. Granted, > maven is new to me and I've got zero experience but the codebase, but > it seems amazing to me how

Re: minor grievance with arithmetic on characters

2009-09-09 Thread B Smith-Mannschott
On Tue, Sep 8, 2009 at 23:35, Stephen C. Gilardi wrote: > > On Sep 8, 2009, at 2:14 AM, Timothy Pratley wrote: > >> According to the docstring compare returns -1, 0 or 1: >> user=> (compare \b \g) >> -5 > > We could fix the doc along the lines of: > > "Comparator. Returns a negative number, zero,

Re: minor grievance with arithmetic on characters

2009-09-09 Thread Miron Brezuleanu
Hello, Coming back to the original question: On Tue, Sep 8, 2009 at 6:50 AM, Timothy Pratley wrote: > > Is there a way to deal with this: > user=> (> \a \b) > java.lang.ClassCastException: java.lang.Character cannot be cast to > java.lang.Number (NO_SOURCE_FILE:0) > > So far the only things I kn

Re: clojure-mode survey

2009-09-09 Thread Michael Kohl
On Wed, Sep 9, 2009 at 3:08 AM, Phil Hagelberg wrote: > This just resets the classpath to include target/dependency/ as well as > any jars in the lib/ directory of your project. I've included this in > the Emacs Starter Kit but haven't included it in clojure-mode yet since > I haven't quite decid

Re: minor grievance with arithmetic on characters

2009-09-09 Thread John Harrop
On Tue, Sep 8, 2009 at 8:18 PM, Timothy Pratley wrote: > > Hi Steve, > > I find the -1, 0, 1 result more useful, but am also wary it hides some > useful information. My preference would be to have the doc-string > changed to what you proposed and keep the neg/pos behaviour > of .compareTo in place

Re: clojure-mode survey

2009-09-09 Thread Rick Moynihan
2009/9/9 Phil Hagelberg : > > Rick Moynihan writes: > >> One problem I do have with clojure-mode/clojure is managing the >> classpaths for clojure projects...  It seems that the typical elisp >> config only has one variable (which is then shared across all clojure >> files) for specifying the cla

Re: clojure-mode survey

2009-09-09 Thread AndrewC.
On Sep 9, 11:02 am, Michael Kohl wrote: > On Wed, Sep 9, 2009 at 3:08 AM, Phil Hagelberg wrote: > > This just resets the classpath to include target/dependency/ as well as > > any jars in the lib/ directory of your project. I've included this in > > the Emacs Starter Kit but haven't included i

Re: Library problem: SWT and Emacs

2009-09-09 Thread srolls
I have had similar issues with swing. Going to the inferior lisp buffer and hitting return once or twice always resolved it. It only happens the first time a window is shown. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: Clojure quickstart maven archetype

2009-09-09 Thread Scott Fleckenstein
When I said central repo, yes, I meant repo1.maven.org. Clojure contrib is only available as a SNAPSHOT there. My actual dependency element looks like: org.clojure clojure-contrib 1.0-SNAPSHOT -Scott On Sep 9, 12:42 am, Fredrik Appelberg wrote: > On Tue, Sep 8, 20

Clojure Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread Fogus
;; largest prime factor (defn lpf "Takes a number n and a starting number d > 1 and calculates the largest prime factor of n starting at number d. usage: (lpf 364362978 2) => 8675309" [n d] (if (> d n) (- d 1) (recur (#(if (zero? (rem % d)) (recur (/ % d))

Re: Clojure Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread eyeris
Why did you define the problem as you did rather than simply "The largest prime factor of n?" On Sep 9, 1:39 pm, Fogus wrote: > ;; largest prime factor > (defn lpf >   "Takes a number n and a starting number d > 1 >    and calculates the largest prime factor of n >    starting at number d. > >

Re: Clojure Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread Timothy Pratley
> (zero? (rem % d)) (= 0 (rem % d)) >     (- d 1) presumably you chose this instead of (dec d) because it converts one real character into whitespace so if you make this: >      (inc d (+ d 1) You can convert another whitespace! [arguably its a meaningful whitespace but lets ignore that for

Re: clojure-mode survey

2009-09-09 Thread Phil Hagelberg
Konrad Hinsen writes: > I work with the development branch regularly updated from github. Do I > conclude correctly that clojure-install is of no use for me? You can let clojure-install perform the initial setup and then simply issue a "git checkout master" from the clojure/ directory and recomp

Re: clojure-mode survey

2009-09-09 Thread Phil Hagelberg
On Sep 9, 7:44 am, "AndrewC." wrote: > > It really does seem like there's a certain demand for it, I stumbled > > upon several blog posts and such where people have trouble setting up > > their Clojure projects. I definitely think that this would be a > > worthwhile addition to clojure-mode. I'm

Re: clojure-mode survey

2009-09-09 Thread Phil Hagelberg
Rick Moynihan writes: > This issue has got me thinking that the real problem appears to be > that there isn't a standard or default way (script) to start up and > run java/clojure projects... i.e. though this solves the problem when > running clojure programs in emacs it doesn't do so for when yo

Content negotiation?

2009-09-09 Thread Richard Newman
Would anyone have any interest in a content negotiation library making its way into contrib? That is, a library with a public function that takes an Accept: header from an HTTP request, and your server-side preferences, and spits out which Content-Type you should produce. This is important

Re: Content negotiation?

2009-09-09 Thread Sean Devlin
Could you put it on GitHub anyway? It would be a good way to evaluate it. On Sep 10, 12:36 am, Richard Newman wrote: > Would anyone have any interest in a content negotiation library making   > its way into contrib? > > That is, a library with a public function that takes an Accept: header   >

Re: How to use vimClojure?

2009-09-09 Thread MarkSwanson
This doesn't work for me. Here is what happens: > > 0. Start ng-server > > 1. Start a fresh vim. > > 2. :setfiletype clojure (a colon command like :w or :q) > > 3. \sr (should open a new window) > > 4. (to go back to first window) ( is Control+w, > > would be Alt+w) > > 5. Type in some function:

Re: Content negotiation?

2009-09-09 Thread Adrian Cuthbertson
> Could you put it on GitHub anyway? It would be a good way to evaluate > it. +1 - I'd be interested in using it. - Adrian. On Thu, Sep 10, 2009 at 6:40 AM, Sean Devlin wrote: > > Could you put it on GitHub anyway?  It would be a good way to evaluate > it. > > On Sep 10, 12:36 am, Richard New

Re: Content negotiation?

2009-09-09 Thread Lance Carlson
This might be good to integrate with ring as well? On Thu, Sep 10, 2009 at 12:46 AM, Adrian Cuthbertson wrote: > >> Could you put it on GitHub anyway?  It would be a good way to evaluate >> it. > >  +1 - I'd be interested in using it. > > - Adrian. > > On Thu, Sep 10, 2009 at 6:40 AM, Sean Devli

Re: Content negotiation?

2009-09-09 Thread Richard Newman
>> Could you put it on GitHub anyway? It would be a good way to >> evaluate >> it. > > +1 - I'd be interested in using it. Your wish is my command :) http://github.com/rnewman/clj-conneg/tree/master I haven't finished the complete sorting algorithm yet (it only uses q- vals, not level and '

Re: Content negotiation?

2009-09-09 Thread Richard Newman
> This might be good to integrate with ring as well? I don't use Ring directly, if at all (just Compojure for now), so it needs to be upstream of that. I have no problem with Ring using it, though. (I imagine that would be trivial if it reached contrib.) --~--~-~--~~~

Re: Clojure Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread MarkSwanson
I took a stab at it. I used: (set! *warn-on-reflection* true) but it didn't tell me anything. I found a Java class that did the same thing and created a Clojure implementation from that. I thought that perhaps if I could force the data types to be BigInteger Clojure would save time by not having

Re: Clojure Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread MarkSwanson
Just for fun I actually tried this: Clojure=> (time (lpf6b 1234567890123456789012345678901234567890)) The prime factorization of 1234567890123456789012345678901234567890 is :5964848081 "Elapsed time: 5519.278432 msecs" I can't confirm the answer is correct. 5.5 seconds sure beats 10 minutes. :-)

Re: Clojure Golf – Episode 2: Largest Prime Factor

2009-09-09 Thread Christophe Grand
I propose to compute the score of a golf competition entry using this function: (defn score [expr] (count (tree-seq coll? #(if (map? %) (apply concat %) (seq %)) expr))) Thus, shorter names and literal anonymous closures won't change the score. On Thu, Sep 10, 2009 at 1:50 AM, Timothy Pratley wr