Primitive arithmetic and mod

2010-05-02 Thread Brian Watkins
I'm trying to speed up computing terms of a simple recurrence where the terms are computed modulo some value each iteration, (defn NF-mod-limit [p q limit] (loop [n 0, nf 0, z 0, S 290797] (if (= n (inc q)) nf (recur (inc n) (mod (+ nf (* (mod S p) z)) limit)

Re: rand-int with bignums

2010-05-02 Thread RandyHudson
Per Alex Osborne's reference to BigInteger constructors, here's a random BigInteger function: (defn rand-bigint [#^BigInteger bign, #^Random rnd] (let [bits (inc (.bitLength bign)) bigr (BigInteger. bits rnd)] (-> bign (.multiply bigr) (.shiftRight bits -- You received this mes

Re: Any Clojure job out there?

2010-05-02 Thread Bruce Durling
The latest Thoughtworks technology radar says that clojure is the best of the functional languages out there at the moment. I'm hoping this will lead to greater adoption. http://www.thoughtworks.com/radar/ FTA: Of the current crop of functional languages, the one we like the most is Clojure: a si

Re: labrepl updated

2010-05-02 Thread Stuart Halloway
More than one clojure or contrib jar file one the classpath, perhaps. Can you try starting the labrepl from the command line and see if you get the same error? Stu I'm getting this error in Eclipse: Clojure 1.2.0-master-SNAPSHOT 1:1 user=> * (require 'labrepl) * (labrepl/-main) # ja

Re: labrepl updated

2010-05-02 Thread Laurent PETIT
Can you send your .project and .classpath files, for analysis ? (Place them in the files section of the google group, please) 2010/5/1 Keno : > I'm getting this error in Eclipse: > > Clojure 1.2.0-master-SNAPSHOT > 1:1 user=>     * (require 'labrepl) >    * (labrepl/-main) > # > java.lang.Exceptio

Re: Defining a namespace inside a let

2010-05-02 Thread alux
Hello Stuart, "they don't work as you'd expect". Ah, I see. Thank you ;-) Hm. Can you point me to some documentation about these special rules then? Many thanks, alux On 30 Apr., 18:10, Stuart Sierra wrote: > "ns" and "in-ns" have special evaluation rules.  In general, they > don't work as

Funcalls vs. lists (Was: Clojure Concurrency Screencast Available)

2010-05-02 Thread Mike Meyer
On Sun, 02 May 2010 13:06:56 +1000 Alex Osborne wrote: > e writes: > > Can you imagine how disruptive it would be at this point to do it the > > other way around?  If you were starting out today without any Lisp > > baggage, it seems TOTALLY obvious to me that lists would have been (1 > > 2 3), a

Re: Funcalls vs. lists (Was: Clojure Concurrency Screencast Available)

2010-05-02 Thread Jarkko Oranen
On May 2, 11:14 pm, Mike Meyer wrote: > On Sun, 02 May 2010 13:06:56 +1000 > To get behavior similar to the vector constructs, you want to use > list, which works like vector, except returning a list instead of a > vector: (list 1 2 3 (print :hello)). It seems that what's missing here > is a sy

Re: My non-ELPA Emacs swank-clojure setup

2010-05-02 Thread Robert Ewald
Am Sonntag, 11. April 2010 00:59:47 schrieb DanL: > On 11 Apr., 00:34, Ævar Arnfjörð Bjarmason wrote: > > > As far as I know, there were problems with the protocol using symbols > > > in CL's package::symbol syntax (and some other characters not being > > > allowed in Clojure) after changes in CVS

Re: Funcalls vs. lists (Was: Clojure Concurrency Screencast Available)

2010-05-02 Thread Mike Meyer
On Sun, 2 May 2010 14:52:17 -0700 (PDT) Jarkko Oranen wrote: > On May 2, 11:14 pm, Mike Meyer 620...@mired.org> wrote: > > On Sun, 02 May 2010 13:06:56 +1000 > > To get behavior similar to the vector constructs, you want to use > > list, which works like vector, except returning a list instead of

Calling for advice on a parser's location data

2010-05-02 Thread joshua-choi
I'm making a parsing library that can keep track of its location in a stream of tokens, and the tokens can be of any type—character, map, and so forth. I need advice on this question: Can you think of an instance where the location would not be a line number and column number, such as {:line 3, :c

HOWTO http.agent ( PUT or potential 500 )

2010-05-02 Thread Timothy Washington
Hey, ok so a noobie question here. I'm trying to use the 'http-agent' function to make HTTP calls. I can do so easily as in fig. 1. But when I try to make a PUT call as in fig. 2, I get a pretty ugly stacktrace, the bottom one having the error "Caused by: java.lang.IllegalArgumentException: No meth

Re: Calling for advice on a parser's location data

2010-05-02 Thread Richard Lyman
On Sun, May 2, 2010 at 6:29 PM, joshua-choi wrote: > I'm making a parsing library that can keep track of its location in a > stream of tokens, and the tokens can be of any type—character, map, > and so forth. I need advice on this question: > > Can you think of an instance where the location would

Re: Calling for advice on a parser's location data

2010-05-02 Thread Timothy Washington
Unless you're dealing with 1) binary data or 2) structured data (ie. XML) where a path is more appropriate, then I think line / column is the way to go. Now, is this a clojure parser? Or a clojure parser generator library that consumes a BNF-like file that defines another lang? As far as I can tel

Re: HOWTO http.agent ( PUT or potential 500 )

2010-05-02 Thread Antony Blakey
On 03/05/2010, at 10:47 AM, Timothy Washington wrote: > Hey, ok so a noobie question here. I'm trying to use the 'http-agent' > function to make HTTP calls. I can do so easily as in fig. 1. But when I try > to make a PUT call as in fig. 2, I get a pretty ugly stacktrace, the bottom > one havin

Re: HOWTO http.agent ( PUT or potential 500 )

2010-05-02 Thread Timothy Washington
Yes, that was it. Thanks On Sun, May 2, 2010 at 10:04 PM, Antony Blakey wrote: > > On 03/05/2010, at 10:47 AM, Timothy Washington wrote: > > > Hey, ok so a noobie question here. I'm trying to use the 'http-agent' > function to make HTTP calls. I can do so easily as in fig. 1. But when I try > to

clojure-contrib diffs?

2010-05-02 Thread Timothy Washington
I've noticed that there are some big clojure-contrib source differences between the 'master' branch and '1.1.0'. For example 1) 'io' is in master, but not 1.1.0 2) json is in master, but json.read and json.write are in 1.1.0 I assume new developments are going into 1.1.0. But is it possible to ke

Re: My non-ELPA Emacs swank-clojure setup

2010-05-02 Thread Ramakrishnan Muthukrishnan
On Mon, May 3, 2010 at 3:43 AM, Robert Ewald wrote: > Am Sonntag, 11. April 2010 00:59:47 schrieb DanL: >> On 11 Apr., 00:34, Ævar Arnfjörð Bjarmason wrote: >> > > As far as I know, there were problems with the protocol using symbols >> > > in CL's package::symbol syntax (and some other character

Re: clojure-contrib diffs?

2010-05-02 Thread Antony Blakey
On 03/05/2010, at 1:06 PM, Timothy Washington wrote: > I've noticed that there are some big clojure-contrib source differences > between the 'master' branch and '1.1.0'. For example 1) 'io' is in master, > but not 1.1.0 2) json is in master, but json.read and json.write are in 1.1.0 > > I ass

Re: Calling for advice on a parser's location data

2010-05-02 Thread Heinz N. Gies
On May 3, 2010, at 3:29 , joshua-choi wrote: > Can you think of an instance where the location would not be a line > number and column number, such as {:line 3, :column 25}? I'd also add :file there (while this does not need to be a physical one it can come in handy) -- You received this mess