Re: bit-and reflection warning

2010-06-02 Thread rzeze...@gmail.com
I was able to make this go away by adding a method to Numbers.java. I have a use case where I'm calling bit-and with two longs tens of millions of times. Is there another way I could avoid this reflection without this change to the Java source? diff --git a/src/jvm/clojure/lang/Numbers.java b/s

Re: apply with constructors

2010-06-02 Thread rzeze...@gmail.com
> Can you let the fn call figure that out for you? Like so: > >     (apply (fn ([p1 p2] (new Connection.Configuration p1 p2)) >                ([p1 p2 p3] (new Connection.Configuration p1 p2 p3))) >            params) > > I realize that reflection is probably better in this case, but was > wonderi

Re: Question on replace/replace-first in #359

2010-06-02 Thread Stuart Halloway
For the cases currently implemented, the perf difference is negligible. I don't think there is anything wrong with a helper protocol, but I also don't think the cond-based approach is a problem, unless there are real use cases for making these open. Pondering whether this should be a protocol w

Re: let's all link to the "getting started" pages!

2010-06-02 Thread Craig Andera
Someone wrote an installer [1] that I've used successfully. [1] http://github.com/paulbatum/clojure-clr/downloads On Wed, Apr 7, 2010 at 4:37 PM, Sean Devlin wrote: > Anyone have instructions for CLR? > > On Apr 7, 2:50 pm, Meikel Brandmeyer wrote: >> Hi, >> >> On Wed, Apr 07, 2010 at 01:53:47P

Re: Emacs - Problem with running tests (yes I installed with ELPA)

2010-06-02 Thread Steve Molitor
The version of slime I am using (20100404) doesn't define any slime-redirect-inferior-output function. Perhaps it has been renamed? Steve On Wed, Jun 2, 2010 at 1:06 PM, Karsten Lang wrote: > I don't suppose > > (add-hook 'slime-connected-hook 'slime-redirect-inferior-output) > > would work? >

Re: Clojure Eclipse Getting Started Question

2010-06-02 Thread Shikhar Mishra
Thanks Matt, that did the trick. On Tue, May 25, 2010 at 2:16 PM, Matthias von Rohr < matthias.vonr...@gmail.com> wrote: > set the cursor somewhere in your (defn...) expression then press Ctrl > + Alt + x (evaluate in REPL). After that you method call should work. > > Matt > > On May 24, 5:08 pm,

Re: apply with constructors

2010-06-02 Thread Mark Rathwell
Ah, makes sense now, thank you. I know the parameter list will be one of three possibilities, so probably makes more sense to specify the conditions than to use reflection. I don't have a repl handy, but either of the below should work: ;; using apply (per Konrad) (cond (= (count params) 2)

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-02 Thread Heinz N. Gies
On Jun 1, 2010, at 22:26 , Sina K. Heshmati wrote: > "Heinz N. Gies" said: > >> The DNS is fixed, try-clojure.org is now working too :) > > Not anymore! I was actually using it. I missed C-a C-k though. You make me cry :P thanks for the hint this time it was my evil doing ;) fixed now! and I p

Re: let's all link to the "getting started" pages!

2010-06-02 Thread mmwaikar
Hi, Sorry for posting to an old thread, but thought this might be a good one to ask. My question is this - isn't ClojureBox an Emacs? If yes, then why don't we include it in the above Wiki? Thanks, Manoj. On Apr 7, 3:39 pm, Avi Schwartz wrote: > On March 30th Eric Thorsen released version 1.1

Re: apply with constructors

2010-06-02 Thread Konrad Hinsen
On 2 Jun 2010, at 21:10, Mike Meyer wrote: If your class has multiple constructors with different arity, there are ways to look up the right constructor using reflection, but I have forgotten the details already. Can you let the fn call figure that out for you? Like so: (apply (fn ([p1

Re: apply with constructors

2010-06-02 Thread Mike Meyer
On Wed, 2 Jun 2010 13:33:30 +0200 Konrad Hinsen wrote: > Constructors calls translate directly to Java constructor calls, meaning that > the number of arguments must be known at compile time. > > Assuming your constructor takes a fixed number of arguments, the easiest > solution to your proble

Re: Having trouble getting full performance from a quad-core with trivial code

2010-06-02 Thread Zak Wilson
ka, I ran some more tests, including partition-work and your version of fac. I also ran some code from http://shootout.alioth.debian.org in both C and Java. On these 10-element sequences, partition-work seems to be a few tens of milliseconds slower than partition-all. It does look generally useful

Re: Emacs - Problem with running tests (yes I installed with ELPA)

2010-06-02 Thread Karsten Lang
I don't suppose (add-hook 'slime-connected-hook 'slime-redirect-inferior-output) would work? On Tue, Jun 1, 2010 at 11:00 PM, Paul Hobbs wrote: > I have a similar issue whenever I try to print anything from slime. > -- > Paul Hobbs > > > On Mon, May 31, 2010 at 11:41 PM, Steve Molitor > wrote:

The State of Clojure, Summer 2010

2010-06-02 Thread Chas Emerick
"I have now been using Clojure as my primary programming language for almost exactly two years. Clojure 1.2 is nearing release. The Clojure community is larger than it ever has been, and shows no sign of slackening its growth. It seems like now would be a good time to take stock of where the

Re: review the clojure.string code

2010-06-02 Thread ataggart
+1 on uppercase / lowercase On Jun 2, 8:49 am, Tom Hickey wrote: > Including a space is correct when changing a string "to upper > case" (hence Java's toUpperCase), though no space would be fine there > as well. > > As a verb, "uppercase" (no space) is correct. So the function should > either mat

Re: review the clojure.string code

2010-06-02 Thread Tom Hickey
Including a space is correct when changing a string "to upper case" (hence Java's toUpperCase), though no space would be fine there as well. As a verb, "uppercase" (no space) is correct. So the function should either match java and be called to-upper-case or (preferably, IMO) simply be uppercase.

Re: clojure.contrib.repl-utils show

2010-06-02 Thread looselytyped
Hello! I figured it out. For the record, it was me being stupid about it. The problem was doing a (use 'clojure.contrib.repl-utils) would barf because 'source' is declared in both clojure.repl and clojure.contrib.repl-utils (This has probably to do with what Sean said - some repl functions are bei

Re: clojure.contrib.repl-utils show

2010-06-02 Thread looselytyped
Hello! I figured it out. For the record, it was me being stupid about it. The problem was doing a (use 'clojure.contrib.repl-utils) would barf because 'source' is declared in both clojure.repl and clojure.contrib.repl-utils (This has probably to do with what Sean said - some repl functions are bei

Question on replace/replace-first in #359

2010-06-02 Thread Sean Devlin
In perusing the patch for ticket #359 (promoting string), I came across the following fn: http://gist.github.com/422392 I was wondering why there is a cond that dispatches on the instance? predicate, instead of a helper protocol being used. Is a helper protocol bad style? Is cond faster? Is it

Re: Android 'dex' stage takes a very long time with Clojure

2010-06-02 Thread MHOOO
No, I have yet to set up a public repo. I'll see to it that I at least set one up for the modified clojure-master project sometime today or tomorrow. As for a hello-world project, I'm currently running into some issues with android's call stack limit: (use 'swank.swank) kinda uses too much of that.

Re: apply with constructors

2010-06-02 Thread Meikel Brandmeyer
Hi, On Jun 2, 2:51 am, Mark Rathwell wrote: > ;; can do it with eval, but what is the correct way? > user=> (eval `(ConnectionConfiguration. ~...@params)) > (eval `(ConnectionConfiguration. ~...@params)) > # org.jivesoftware.smack.connectionconfigurat...@a0430b6> The best way is to use reflecti

Re: apply with constructors

2010-06-02 Thread Konrad Hinsen
On 02.06.2010, at 02:51, Mark Rathwell wrote: > I apologize for my ignorance, I've been struggling with this one for a couple > hours and can't figure it out. Why does apply not work with constructors, > special forms, etc.? Is there some other standard way to unpack a list? My > question is

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-02 Thread sergey-miryanov
Feka, do you select a text on page and press button in toolbar? On Jun 1, 8:49 pm, feka wrote: > Good idea! Thanks. (And try-clojure is good idea, too. So they also > merit the thanks.) > > I can't make it grab the selection and evaluate it though. Am I > missing something? Mac OS X 10.6.3, Chrom

apply with constructors

2010-06-02 Thread Mark Rathwell
I apologize for my ignorance, I've been struggling with this one for a couple hours and can't figure it out. Why does apply not work with constructors, special forms, etc.? Is there some other standard way to unpack a list? My question is outlined below, I have a variable length list of paramete

Re: Complex type in clojure

2010-06-02 Thread Konrad Hinsen
On 2 Jun 2010, at 02:38, Daniel wrote: This touches upon another subject though: Clojure lacks a good math library (though Liebke might kill me for that). Incanter is great but it's not a math library in the sense of what you propose. I'd say you have a chance to survive :-) Has anybody th

Re: Complex type in clojure

2010-06-02 Thread Konrad Hinsen
On 1 Jun 2010, at 20:24, Travis Hoffman wrote: I was curious what it would take to add a complex number type to Clojure Core. If anyone else is curious, it doesn't take much: 1.) Add clojure.lang.Complex 2.) Add a Pattern and code to match, parse and create complex numbers in LispReader (parses