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 b

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 wrote: > > You can use the same idea fo

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 elem

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 wor

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 a

Re: Enhanced primitive support - redux

2010-06-27 Thread Daniel
Thirded. On Jun 25, 4:55 pm, Mark Engelberg wrote: > On Fri, Jun 25, 2010 at 2:39 PM, Garth Sheldon-Coulson 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 equiv. I > > also think (= 3.0

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 wrote: > My sense from reading Rich's writing on the subject is that 'contains? > was named with the use of sets

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. Simple

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 si

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=nbody&lang=all The fastest code I've managed so far is here: http://github.com/j-g-faustus/Clojure-test-code

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 th

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 wrote: > On Sat, Jun 26, 2010 at 4:04 AM, Rich Hickey wrote: > > equiv, the revenge of num > > Has it already been decided that some sort of this new numeric tower > wil

Re: Converting list to Map

2010-06-27 Thread Mike Meyer
On Sat, 26 Jun 2010 15:54:34 -0700 (PDT) hsarvell 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))) > (hash-map) >

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 a

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 wrote: > > 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. > > On profiling I hav

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

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 ema

Re: the joys of lisp

2010-06-27 Thread Mike Meyer
On Sun, 27 Jun 2010 11:58:16 -0700 (PDT) cageface 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 advantage of Py

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 meta-programm

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 ad

Re: the joys of lisp

2010-06-27 Thread Mike Meyer
On Sun, 27 Jun 2010 12:41:36 -0700 (PDT) cageface 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 seems to have ba

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 wrote: > Hi, > > Is there any way to generate class in runtime and then use it? > How far I

Re: the joys of lisp

2010-06-27 Thread cageface
On Jun 27, 1:17 pm, Mike Meyer 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 > never-to-sufficiently-cursed augmented assignment opera

Life on the bleeding edge

2010-06-27 Thread Mark Engelberg
I spent some time today trying unsuccessfully to get the equiv branch up and running on Windows. I'd appreciate some guidance. I downloaded git, installed git. Used git to "clone" the github repository. Used git to "checkout origin/equiv". Downloaded ant. Installed ant. Ran ant. Seemed to work. U

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 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 clojure.jar. On Linux,

Re: Life on the bleeding edge

2010-06-27 Thread Mark Engelberg
On Sun, Jun 27, 2010 at 5:33 PM, Michał Marczyk 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 clojure.contrib.test_io and 1

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 03:23, Mark Engelberg 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 something else goi

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: clojure/lang/

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 05:11, Garth Sheldon-Coulson 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 Groups "Cl

Re: Dynamic gen-class

2010-06-27 Thread Brian Hurt
On Sun, Jun 27, 2010 at 4:54 PM, rob levy 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. Most of th

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 05:11, Garth Sheldon-Coulson 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 to me t

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 wrote: > On 28 June 2010 05:11, Garth Sheldon-Coulson 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 ru

Re: Life on the bleeding edge

2010-06-27 Thread Michał Marczyk
On 28 June 2010 06:11, Garth Sheldon-Coulson 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 namespaces

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 gro

Re: Dynamic gen-class

2010-06-27 Thread Meikel Brandmeyer
Hi, On Jun 28, 5:38 am, Brian Hurt wrote: > This is actually something that has been bugging me for a while.  Most of > the time this isn't a problem (being unable to generate classes in the repl, > basically), except in one case: exceptions.  It'd be nice to be able to > define classes that inh