RAM for a Ring app

2010-06-27 Thread David Beckwith
Approximately how much RAM is required to deploy a small Ring app on 64-bit Ubuntu? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be

Re: Drawable Sets

2010-06-27 Thread Nicolas Oury
That more or less what I had in mind, but I was wondering if someone has already an Open Sourced code for HashTries in Clojure. But I can try your idea with binary tree first. It seems simpler. Thanks again, Nicolas On Sun, Jun 27, 2010 at 5:13 AM, Jules julesjac...@gmail.com wrote: You can

Re: Drawable Sets

2010-06-27 Thread Nicolas Oury
That's a super cool idea, but my data have no similar size. Anyway, that's both simple and always better than what I do.(At worst it has an expected complexity of O(n) if all the mass is in one value and the n-1 are zero-ish). I think you can solve the holes on delete by permuting the removed

Dynamic gen-class

2010-06-27 Thread Michael Jaaka
Hi, Is there any way to generate class in runtime and then use it? How far I can only generate interfaces. This works: (do (gen-interface :name test.commons.Me :methods [[ me [ String ] void ]]) (def z (reify test.commons.Me (me [t z] (println hello

Re: Duplicate key bug in hash-maps

2010-06-27 Thread Tim Robinson
Can I change the title to: Duplicate key error handling feature in hash-sets ? I was using the '#' thinking it was short for a hash-map, rather than a hash-set. Clojure has more data structures available than I'm used to working with. So thanks for the error handling. Tim On Jun 25, 9:37 

Re: Enhanced primitive support - redux

2010-06-27 Thread Daniel
Thirded. On Jun 25, 4:55 pm, Mark Engelberg mark.engelb...@gmail.com wrote: On Fri, Jun 25, 2010 at 2:39 PM, Garth Sheldon-Coulson g...@mit.edu wrote: Personally, I think (= 3 3M) = true and (= 3/10 0.3M) = true would be nice to have, given that (= 3 3N) = true. Both are currently false in

Re: How does contains? work?

2010-06-27 Thread ru
Thank you very much to all for comprehensive explanations. As newcomer to Clojure dare to remark that this is not very consistent semantics of contains :) On 25 июн, 21:25, ataggart alex.tagg...@gmail.com wrote: My sense from reading Rich's writing on the subject is that 'contains? was named

Re: Duplicate key bug in hash-maps

2010-06-27 Thread Mike Anderson
I agree that duplicate keys in literals are probably a coder error but IMO this deserves some kind of compiler warning rather than an error. You're going to get into lots of sticky situations otherwise that only confuse people if the semantics are different between literals and other usage.

Re: Duplicate key bug in hash-maps

2010-06-27 Thread Anton Josua
Easy to explain - absolutely, consistent - mm, not really... I found this new behavior a bit confusing, imo it breaks principle of least surprise. This feature is uncommon in dynamic languages (even Scala allows duplicate keys - Set('a,'a)/Map('a-1,'a-1)). Also, from the practical point of view,

Re: Clojure Futures Docs and Functionality

2010-06-27 Thread Ryan Senior
Sounds good to me. The first version of that function I wrote without returning nil, but just bubbling up the exception. I changed it because I couldn't think of another area of the Clojure core that threw an exception like that. Looking through some of the agents code, I think there are some

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-27 Thread j-g-faustus
Possibly of interest here, although I've only tested it using Clojure 1.1: I just did an implementation of the n-body problem from http://shootout.alioth.debian.org/u32q/benchmark.php?test=nbodylang=all The fastest code I've managed so far is here:

Question re: pmap and the number of available processors

2010-06-27 Thread Todd
(running clojure 1.2 snapshot) Q1: Why does pmap use the number of available processors + 2? I would have thought it would just use the number of avail processors... Q2: Could someone clear up my misunderstanding of pmap w/ respect to the code snippets below? Pmap doesn't seem to be limiting

Converting list to Map

2010-06-27 Thread hsarvell
I tried to find something in core / on Google to do this but didn't, here is what I have anyway: (defn lst-to-map [lst] (reduce (fn [hsh chunk] (assoc hsh (first chunk) (last chunk))) (hash-map) (partition 2 lst))) Is there an easier/shorter way? -- You received

Question: pmap + number of threads + number of cpus

2010-06-27 Thread toddg
(running clojure 1.2 snapshot) Q1: Why does pmap use the number of available processors + 2? I would have thought it would just use the number of avail processors... Q2: Could someone clear up my misunderstanding of pmap w/ respect to the code snippets below? Pmap doesn't seem to be limiting the

Re: Enhanced primitive support - redux

2010-06-27 Thread Daniel
If there is some sort of new numeric tower on the plate, what would be some desirable properties? On Jun 25, 10:58 pm, Andrzej ndrwr...@googlemail.com wrote: On Sat, Jun 26, 2010 at 4:04 AM, Rich Hickey richhic...@gmail.com wrote: equiv, the revenge of num Has it already been decided that

Re: Converting list to Map

2010-06-27 Thread Mike Meyer
On Sat, 26 Jun 2010 15:54:34 -0700 (PDT) hsarvell hsarv...@gmail.com wrote: I tried to find something in core / on Google to do this but didn't, here is what I have anyway: (defn lst-to-map [lst] (reduce (fn [hsh chunk] (assoc hsh (first chunk) (last chunk)))

Re: Protocols

2010-06-27 Thread Rich Hickey
On Jun 27, 2010, at 1:09 AM, Mark Engelberg wrote: Is there a list somewhere of all the protocols built-in to Clojure 1.2's core that are available for extension? There are no extension points built on protocols in Clojure yet. Delivering protocols is step one, re-architecting the core

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-27 Thread Nicolas Oury
On Sat, Jun 26, 2010 at 6:56 PM, j-g-faustus johannes.fries...@gmail.comwrote: On my machine this is about 4x slower than the shootout Java implementation. Using Java as the baseline and comparing my local results to the shootout timings, it puts Clojure 1.1 on par with Erlang, Go and OCaml.

Re: Drawable Sets

2010-06-27 Thread Garth Sheldon-Coulson
I think you can solve the holes on delete by permuting the removed element with the last element and keeping a map from value to their index. Good idea! Thanks you very much for these suggestions. You're welcome. The hashtrie is a much better idea for this situation, of course. Couldn't

the joys of lisp

2010-06-27 Thread cageface
When I read about new features in other languages that would be simple macros in Lisp I just have to smile: http://docs.python.org/dev/reference/compound_stmts.html#with -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: the joys of lisp

2010-06-27 Thread Mike Meyer
On Sun, 27 Jun 2010 11:58:16 -0700 (PDT) cageface milese...@gmail.com wrote: When I read about new features in other languages that would be simple macros in Lisp I just have to smile: http://docs.python.org/dev/reference/compound_stmts.html#with Many in the Python community consider this an

Re: State of Clojure web development

2010-06-27 Thread Straszheim, Jeff
At Akamai we are using Clojure combined with Compojure for a project that involves the live transcoding of mobile content. I can't talk about the details, nor mention any specific libraries or features we are using, except to say that we chose Clojure for the normal reasons: its

Re: the joys of lisp

2010-06-27 Thread cageface
Python definitely seems to be the product of a very different design philosophy than Lisp. I've always felt it was too prescriptive. Omitting features that *might* be misused in an effort to keep the language simple seems to have backfired on them. Too keep up with the competition they've had to

Re: the joys of lisp

2010-06-27 Thread Mike Meyer
On Sun, 27 Jun 2010 12:41:36 -0700 (PDT) cageface milese...@gmail.com wrote: Python definitely seems to be the product of a very different design philosophy than Lisp. I've always felt it was too prescriptive. Omitting features that *might* be misused in an effort to keep the language simple

Re: Dynamic gen-class

2010-06-27 Thread rob levy
HI Michael, If I understand correctly, the proxy function might be what you are looking for. I think gen-class can only be used with AOT compilation. -Rob On Sun, Jun 27, 2010 at 8:19 AM, Michael Jaaka michael.ja...@googlemail.com wrote: Hi, Is there any way to generate class in runtime

Re: the joys of lisp

2010-06-27 Thread cageface
On Jun 27, 1:17 pm, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: Not quite - it's to keep the language *readable*. And if there's a use case for a feature that outweighs the damage done by abusing it, they'll add it. Witness with, list comprehensions, and those

Re: the joys of lisp

2010-06-27 Thread rob levy
Certainly macros can be dangerous if used recklessly or clumsily, but isn't trusting the programmer and giving him powerful tools what Lisp is all about? No other language provides the same power of expression. A tour through the Clojure code demonstrates just how powerful this idea is and

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 01:53, Mark Engelberg mark.engelb...@gmail.com wrote: Ran ant.  Didn't work (no ant build file.  Why does clojure-contrib have a different build process than clojure?). Good question. Ran maven package in the clojure-contrib directory. You need to tell it where to look for

Re: Life on the bleeding edge

2010-06-27 Thread Mark Engelberg
On Sun, Jun 27, 2010 at 5:33 PM, Michał Marczyk michal.marc...@gmail.com wrote: mvn package -Dclojure.jar=/absolute/path/to/clojure.jar Thanks. I had tried that, but I got further as soon as I tried: mvn package -Dclojure.jar=c:/absolute/path/to/clojure.jar I'm now getting 3 failures in

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 03:23, Mark Engelberg mark.engelb...@gmail.com wrote: Thanks.  I had tried that, but I got further as soon as I tried:  mvn package -Dclojure.jar=c:/absolute/path/to/clojure.jar I'm now getting 3 failures in clojure.contrib.test_io and 1 in test_profile. Is this normal, or is

Re: Life on the bleeding edge

2010-06-27 Thread Garth Sheldon-Coulson
When I try to compile clojure-contrib with the equiv branch on archlinux, maven 2.2.1, jre 1.6.0_20, I get: Compiling clojure.contrib.condition.Condition to /mnt/hgfs/sirfoobar/Documents/Eclipse/clojure-contrib/target/classes Exception in thread main java.lang.NoClassDefFoundError:

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 05:11, Garth Sheldon-Coulson g...@mit.edu wrote: When I try to compile clojure-contrib with the equiv branch on archlinux, maven 2.2.1, jre 1.6.0_20, I get: Be sure to run mvn clean first. Sincerely, Michał -- You received this message because you are subscribed to the Google

Re: Dynamic gen-class

2010-06-27 Thread Brian Hurt
On Sun, Jun 27, 2010 at 4:54 PM, rob levy r.p.l...@gmail.com wrote: HI Michael, If I understand correctly, the proxy function might be what you are looking for. I think gen-class can only be used with AOT compilation. -Rob This is actually something that has been bugging me for a while.

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 05:11, Garth Sheldon-Coulson g...@mit.edu wrote: Compiling clojure.contrib.condition.Condition to /mnt/hgfs/sirfoobar/Documents/Eclipse/clojure-contrib/target/classes Exception in thread main java.lang.NoClassDefFoundError: clojure/lang/ILookupHost Ah, sorry, it just occurred

Re: Life on the bleeding edge

2010-06-27 Thread Garth Sheldon-Coulson
Ah, thanks. I also see no test failures (archlinux). On Sun, Jun 27, 2010 at 11:31 PM, Michał Marczyk michal.marc...@gmail.comwrote: On 28 June 2010 05:11, Garth Sheldon-Coulson g...@mit.edu wrote: When I try to compile clojure-contrib with the equiv branch on archlinux, maven 2.2.1, jre

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 06:11, Garth Sheldon-Coulson g...@mit.edu wrote: Ah, thanks. I also see no test failures (archlinux). After realising that the not-AOT-compiled namespaces might still break when require'd, I went ahead and tested a couple of them. There was about a 50/50 split between the working

Re: State of Clojure web development

2010-06-27 Thread Timothy Washington
I am using clojure to rewrite an online bookkeeping application (currently only a test site). I have wanted to learn Lisp and functional programming for a while now. And the emergence of Clojure, and the need to refactor my application, gave me the opportunity. While I'm still new to the language

Re: Life on the bleeding edge

2010-06-27 Thread Mark Engelberg
OK, I just tried building clojure-contrib pointing at a clojure.jar built from the current master branch. I get the same errors (on Windows). Here are more details: Testing clojure.contrib.test-io FAIL in (test-as-url) (run-test9074812622524104689.clj:45) expected: (= (URL. file:/foo) (as-url

Re: Life on the bleeding edge

2010-06-27 Thread Mark Engelberg
I ran mvn clean first. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this