Re: Primitive arithmetic and mod

2010-05-03 Thread Alex Osborne
Brian Watkins writes: > I'll try rem for time but I see that I still have to cast to long; > Clojure doesn't think (rem (long ) (long x)) is a long. The > error is "recur arg for primitive local: nf must be matching > primitive." Looks like it's casting it back to an integer. Also look

Re: Primitive arithmetic and mod

2010-05-03 Thread Brian Watkins
Thank you for the pointer to unchecked-remainder. That runs much better. -B On May 3, 6:23 pm, kaukeb wrote: > Using unchecked-remainder and adding a type declaration to the last > constant keeps the primitives unboxed and improves performance by a > factor of 6 for me. I couldn't say whether t

Re: Primitive arithmetic and mod

2010-05-03 Thread Brian Watkins
The main example is (NF-mod-limit 61 1000 (reduce * (repeat 10 61))) It runs in about 10 seconds but this is somewhat typical of other computations I want to be able to do that take longer. I'd just like to be able to make the integer math as fast as is reasonable in Clojure. I'll try rem f

Re: Monad problem: rewriting a recursive domonad call to not blow up the stack

2010-05-03 Thread David Barksdale
On May 2, 10:59 pm, David Barksdale wrote: > On Dec 28 2009, 7:03 am, Konrad Hinsen > wrote: > > > > > On 27.12.2009, at 01:47, samppi wrote: > > > > creates a new rule that repeats a given subrule. The problem with rep+ > > > right now is that it increases the stack for every token it consumes

1.2 release ?

2010-05-03 Thread lprefontaine
Hi all, it's not that I want to put pressure on anyone here but there has been a number of discussions about the 1.2 release and I was wondering what's the horizon for a first release ? We are still in prod with 1.0 but some are salivating about some of the features of 1.2. We did not move to 1.1

Re: Any Clojure job out there?

2010-05-03 Thread Sean Corfield
On Mon, May 3, 2010 at 10:21 AM, Olivier Lefevre wrote: > I find it interesting that they use both Clojure and Scala besides Java: > I would have thought that these two represent opposite takes on post- or > beyond-Java alternatives and that they'd use either one or the other. I'm using Scala ins

Re: Primitive arithmetic and mod

2010-05-03 Thread kaukeb
Using unchecked-remainder and adding a type declaration to the last constant keeps the primitives unboxed and improves performance by a factor of 6 for me. I couldn't say whether there's a reason rem and mod don't work like you'd expect here. (defn NF-mod-limit [p q limit] (let [p (long p) q (lo

Re: Primitive arithmetic and mod

2010-05-03 Thread David Nolen
On Mon, May 3, 2010 at 4:21 PM, Brian Watkins wrote: > Any ideas about this? > > On May 2, 1:44 am, Brian Watkins wrote: > > 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] > >

Re: Trouble with Leiningen and Autodoc

2010-05-03 Thread joshua-choi
Actually, disregard the message above! You don't want the latest tree on the develop branch; it currently throws errors because defalias doesn't work with macros anymore. You want to use the tree at the tag 3.α.3! My apologies. On May 3, 5:15 pm, joshua-choi wrote: > Yes,http://github.com/joshua-

Re: Trouble with Leiningen and Autodoc

2010-05-03 Thread joshua-choi
Yes, http://github.com/joshua-choi/fnparse/tree/develop. You must use the latest tree in the develop branch (which is at the time of this writing commit "baf3b39f51fdd3893471f52d330336b5a794fa6d"). Thanks for the help, and I look forward to what you figure out. On May 3, 12:12 pm, Tom Faulhaber

Re: About paths

2010-05-03 Thread Alex Osborne
Paulo Candido writes: > I have a script, say "foo.clj" in a namespace "com.company.ns". > "foo.clj" uses functions from another script, "bar.clj" in the same > namespace. "foo"'s namespace has the line "(:use com.company.ns.bar)". > It works in the REPL, it works inside Netbeans with Enclojure. >

About paths

2010-05-03 Thread Paulo Candido
I have a very basic doubt: I have a script, say "foo.clj" in a namespace "com.company.ns". "foo.clj" uses functions from another script, "bar.clj" in the same namespace. "foo"'s namespace has the line "(:use com.company.ns.bar)". It works in the REPL, it works inside Netbeans with Enclojure. Now

Re: clojure-contrib diffs?

2010-05-03 Thread Timothy Washington
Oh, I see I see. Good to know. Thank-you sir. On Sun, May 2, 2010 at 11:55 PM, Antony Blakey wrote: > > 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)

Re: Any Clojure job out there?

2010-05-03 Thread Dimitry Gashinsky
Hi, I am VP of Engineering for a financial technology startup Pico Quantitative Trading http://www.picotrading.com. We are located in New York and we are looking for people with Clojure and Financial background. We have around 20 thousand lines of Clojure code already and it is growing quickly.

Re: Primitive arithmetic and mod

2010-05-03 Thread Brian Watkins
Any ideas about this? On May 2, 1:44 am, Brian Watkins wrote: > 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 >    

Re: StackOverflow exception problem in filter

2010-05-03 Thread Anders Rune Jensen
On Mon, May 3, 2010 at 7:42 PM, Heinz N. Gies wrote: > > On May 3, 2010, at 20:20 , Stuart Halloway wrote: > >> Not all the way to a solution, but here is a trivial example that >> demonstrates the issue: >> >> (def x >>  (loop [ct 0 >>         s (lazy-seq)] >>    (if (> ct 1) >>      s >>  

Re: Trouble with Leiningen and Autodoc

2010-05-03 Thread Tom Faulhaber
Hi Joshua, Autodoc depends on clojure 1.1, which Phil has suggested might be a problem (he told me not to depend on a clojure version at all). Let me pull that dependency and see if that fixes the problem. Is this in your repo on github? Tom On May 1, 7:17 pm, joshua-choi wrote: > This is my

Re: StackOverflow exception problem in filter

2010-05-03 Thread Heinz N. Gies
On May 3, 2010, at 20:20 , Stuart Halloway wrote: > Not all the way to a solution, but here is a trivial example that > demonstrates the issue: > > (def x > (loop [ct 0 > s (lazy-seq)] >(if (> ct 1) > s > (recur (inc ct) (lazy-seq (filter identity s)) > > x > =>

Re: Any Clojure job out there?

2010-05-03 Thread Olivier Lefevre
On 5/2/2010 12:55 AM, ieslick wrote: Compass Labs is a silicon valley based social media startup company. Their data mining team just switched all their internal tools and data mining work to Clojure (production infrastructure is mostly Java/Scala/C) I find it interesting that they use both Clo

Re: StackOverflow exception problem in filter

2010-05-03 Thread Stuart Halloway
Not all the way to a solution, but here is a trivial example that demonstrates the issue: (def x (loop [ct 0 s (lazy-seq)] (if (> ct 1) s (recur (inc ct) (lazy-seq (filter identity s)) x => java.lang.StackOverflowError Hello In a small project of mine, to

Re: clojure 1.2 seq fn enhancement FAQ

2010-05-03 Thread Olivier Lefevre
On 4/29/2010 6:49 PM, Michael Gardner wrote: +1. I can't imagine any use case for looking up a whole [key, value] pair in a hash-map. Agreed. The whole point of a map is to provide key-based lookup. Iterating over all (key, value) pairs in the map makes sense, not so much looking for one in pa

Re: Reading the manifest file

2010-05-03 Thread Laurent PETIT
Ralph, Using the Class.forName alone will not suffice, you'll also have to AOT compile your code, I guess. OSGi environments like Eclipse or other OSGi containers will more and more separate things into "bundle" class loaders, and in this context using JVM wide utilities or the context classloade

StackOverflow exception problem in filter

2010-05-03 Thread Anders Rune Jensen
Hello In a small project of mine, to learn clojure, I've run into a pesky stackoverflow bug. To sum up the problem, I have a compojure project running on clojure 1.1. My data model is just an in-memory ref to a (2300) items big list. When I a request in, I select what I need out from this in-memo

Re: Interesting contrast in core

2010-05-03 Thread Armando Blancas
> I'm curious why hash-map uses a form to createWithCheck, and hash-set > uses a static method. They both use a static method, though hash-set uses the newer idiomatic syntax. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Reading the manifest file

2010-05-03 Thread Stuart Sierra
On May 3, 11:16 am, Ralph wrote: > Yes, but I don't believe that it guarantees that you will get the > manifest for the enclosing JAR file if you have more than one. I don't think that's possible in the general sense. Application containers like OSGI may provide this functionality. -S -- You r

Re: Interesting contrast in core

2010-05-03 Thread Michael Wood
On 3 May 2010 16:13, Sean Devlin wrote: > These two fns are right next to each other in core: > > (defn hash-map >  "keyval => key val >  Returns a new hash map with supplied mappings." >  ([] {}) >  ([& keyvals] >   (. clojure.lang.PersistentHashMap (createWithCheck keyvals > > (defn hash-set

Re: Reading the manifest file

2010-05-03 Thread Ralph
Yes, but I don't believe that it guarantees that you will get the manifest for the enclosing JAR file if you have more than one. On May 3, 10:28 am, Nurullah Akkaya wrote: > (let [url (ClassLoader/getSystemResource "META-INF/MANIFEST.MF") >       manifest (java.util.jar.Manifest. (.openStream url

Re: Reading the manifest file

2010-05-03 Thread Nurullah Akkaya
(let [url (ClassLoader/getSystemResource "META-INF/MANIFEST.MF") manifest (java.util.jar.Manifest. (.openStream url))] (println (.entrySet (.getMainAttributes manifest ClassLoader/getSystemResource does allow you to get rid of Class/forName... -- Nurullah Akkaya http://nakkaya.com

Interesting contrast in core

2010-05-03 Thread Sean Devlin
These two fns are right next to each other in core: (defn hash-map "keyval => key val Returns a new hash map with supplied mappings." ([] {}) ([& keyvals] (. clojure.lang.PersistentHashMap (createWithCheck keyvals (defn hash-set "Returns a new hash set with supplied keys." ([]

Reading the manifest file

2010-05-03 Thread Ralph
Crossposted to StackoverFlow. How can a Clojure program find its own MANIFEST.MF (assuming it is packaged in a JAR file). I am trying to do this from my "-main" function, but I can't find a class to use in the following code: (.getValue (.. (java.util.jar.Manifest. (.openStre

Re: Debugger REPL feature request

2010-05-03 Thread JS
>On May 1, 10:05 pm, Phil Hagelberg wrote: > Have you read about this? > > http://hugoduncan.org/post/2010/swank_clojure_gets_a_break_with_the_l... Looks good! Thnx for the link. > If you are going to interact with other libraries on the JVM, you must > be capable of handling Java exceptions. Y

Re: Monad problem: rewriting a recursive domonad call to not blow up the stack

2010-05-03 Thread David Barksdale
On Dec 28 2009, 7:03 am, Konrad Hinsen wrote: > On 27.12.2009, at 01:47, samppi wrote: > > > creates a new rule that repeats a given subrule. The problem with rep+ > > right now is that it increases the stack for every token it consumes, > > which overflows the stack with large amounts of tokens.

Re: Any Clojure job out there?

2010-05-03 Thread Robert J Berger
We're on the lookout to hire folks into Clojure. Our entire backend is now in Clojure. We're also leveraging Hadoop/HBase, RabbitMQ, and Javascript among other tech.. We are finding that the use of Clojure allows us to do things with a very small team that would have been quite difficult with other

Re: labrepl: kl...@feersum:~/projects/labrepl$ script/repl java.lang.ExceptionInInitializerError (control.clj:9)

2010-05-03 Thread gnash
I still seem to be having this problem with the latest from github. This is what is listed in my project.clj [org.clojure/clojure "1.2.0-master-20100430.160229-59"] Yields: Clojure 1.2.0-master-SNAPSHOT user=> (require 'labrepl) java.lang.ExceptionInInitializerError (control.c