Re: gen-class not capturing the expected *ns*

2009-08-06 Thread ataggart
On Aug 5, 9:11 pm, Richard Newman holyg...@gmail.com wrote: In testing out clojure.contrib.logging within a generated servlet, I noticed that the value of *ns* is always clojure.core, and not the ns of the code. I have observed this too (running in SailFin, which is based on  

Current API doc (for HEAD)

2009-08-06 Thread Howard Lewis Ship
Is there a URL for the current API doc? I'm thinking of moving some of my code up to HEAD for clojure clojure-contrib and I need to adapt to things like the test package moving to clojure. -- Howard M. Lewis Ship Creator of Apache Tapestry Director of Open Source Technology at Formos

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread Richard Newman
Bah! I tried to simplify the example code, and missed conveying the actual problem. Your example code (and sadly, mine) pulls *ns* at runtime, the logging macro doesn't; it writes the value of the *ns* at macro-expansion-time precisely so that it will be the right value when called. Are

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread ataggart
On Aug 5, 11:24 pm, Richard Newman holyg...@gmail.com wrote: Bah! I tried to simplify the example code, and missed conveying the actual problem.  Your example code (and sadly, mine) pulls *ns* at runtime, the logging macro doesn't; it writes the value of the *ns* at macro-expansion-time

Re: Clojure as a First Language

2009-08-06 Thread Lauri Pesonen
Seth, 2009/8/6 Seth seth.schroe...@gmail.com: I hope that learning a Lisp first is a good idea for novice programmers, because I intend to inflict Clojure on my poor children. (They didn't take to http://scratch.mit.edu/ and Google's rehash of BASIC is a non-starter). There was a post

Re: Clojure as a First Language

2009-08-06 Thread cody koeninger
On Aug 6, 3:22 am, Lauri Pesonen lauri.peso...@iki.fi wrote: There was a post recently on LtU about a paper by Matthias Felleisen et al. (of Little Schemer fame) about a functional teaching language that they've been using in schools and freshman classes to teach kids how to program. I'm

Re: Package manager proposal

2009-08-06 Thread Lauri Pesonen
Hi Meikel, 2009/8/5 Meikel Brandmeyer m...@kotka.de: Well, this is independent of whether you have a C or Java library. You can install each C library in its own directory and tell the linker to look there. Then you have basically a .jar like setup: If you don't tell the linker the right

with-out-str assumes Unix line ends

2009-08-06 Thread Anne Ogborn
(use 'clojure.contrib.duck-streams) (spit C:\\test.txt (with-out-str (println foo) (println bar) (flush))) On my XP Tablet OS computer results in a file with unix line endings. Is this proper behavior? --~--~-~--~~~---~--~~ You

Re: Question about pmap

2009-08-06 Thread Andy Fingerhut
On Aug 5, 6:09 am, Rich Hickey richhic...@gmail.com wrote: On Wed, Aug 5, 2009 at 8:29 AM, Johann Krausjohann.kr...@gmail.com wrote: Could it be that your CPU has a single floating-point unit shared by 4 cores on a single die, and thus only 2 floating-point units total for all 8 of your

Re: Package manager proposal

2009-08-06 Thread Daniel
On Thu, Aug 6, 2009 at 4:12 PM, Lauri Pesonenlauri.peso...@iki.fi wrote: 2009/8/5 Meikel Brandmeyer m...@kotka.de: Well, this is independent of whether you have a C or Java library. You can install each C library in its own directory and tell the linker to look there. Then you have basically

Re: Transient Data Structures

2009-08-06 Thread Rich Hickey
On Aug 5, 10:10 pm, Luc Prefontaine lprefonta...@softaddicts.ca wrote: I like this very much... that's the kind of clever optimizations that preserves Clojure principles and can yield significant performance increases. This could also help dealing with performance critics in these small

Re: Package manager proposal

2009-08-06 Thread Antony Blakey
On 06/08/2009, at 8:58 PM, Daniel wrote: Have a look at Buckminster: http://www.eclipse.org/buckminster/ Not sure if it's going to work for non-JVM approaches (you'll probably have to code up a plugin of some sort), but it's a meta package manager, and can do more than just dependency

Re: Package manager proposal

2009-08-06 Thread Daniel
On Thu, Aug 6, 2009 at 7:07 PM, Antony Blakeyantony.bla...@gmail.com wrote: This is the first I've heard of this project, but what about the 255 page user guide available from: http://mirror.cc.vt.edu/pub/eclipse/tools/buckminster/doc/BuckyBook.pdf  ? Ah, nice one. Hasn't been there last

Re: Current API doc (for HEAD)

2009-08-06 Thread Rich Hickey
On Thu, Aug 6, 2009 at 2:07 AM, Howard Lewis Shiphls...@gmail.com wrote: Is there a URL for the current API doc?  I'm thinking of moving some of my code up to HEAD for clojure clojure-contrib and I need to adapt to things like the test package moving to clojure. -- There isn't yet. The

Re: Question about pmap

2009-08-06 Thread Nicolas Oury
Hello, I will try to have a guess. If 98% of time is spend allocating Doubles, the program is loading new lines of memory in cache every n Doubles. At some point down the different levels of cache, you have a common cache/main memory for both cores and the bus to this memory has to be shared in

Re: Question about pmap

2009-08-06 Thread Nicolas Oury
Hello again, Another interesting test: replace the double operation by something longer, that won't allocate anything. (a long chain of math functions with primitive types...), and see if the parallelism is better. Best, Nicolas. On Thu, Aug 6, 2009 at 2:32 PM, Nicolas Oury

Re: with-out-str assumes Unix line ends

2009-08-06 Thread Mike Hinchey
What does this return on Windows? (with-out-str (.println (java.io.PrintWriter. *out*))) If it's \r\n, then maybe (newline) should be changed to print (System/getProperty line.separator) instead of \newline as it does now. Thoughts? -Mike On Thu, Aug 6, 2009 at 1:03 AM, Anne Ogborn

Re: Question about pmap

2009-08-06 Thread Bradbev
On Aug 6, 3:07 am, Andy Fingerhut andy_finger...@alum.wustl.edu wrote: On Aug 5, 6:09 am, Rich Hickey richhic...@gmail.com wrote: On Wed, Aug 5, 2009 at 8:29 AM, Johann Krausjohann.kr...@gmail.com wrote: Could it be that your CPU has a single floating-point unit shared by 4 cores on

Re: Package manager proposal

2009-08-06 Thread Phil Hagelberg
Lauri Pesonen lauri.peso...@iki.fi writes: Drawing a parallel between Ruby and Clojure, a Clod package could expect jars to be available on the platform at package install time. It would be up to the user to install those jars before trying to install a Clod package. The user is free to

Re: Question about pmap

2009-08-06 Thread Sean Devlin
FYI IEEE doubles are typically 64 bit IEEE floats are typically 32 bit. The wikipedia article is good: http://en.wikipedia.org/wiki/IEEE_754-2008 The IEEE standard (requires login): http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=4610935 I'm not sure how the JVM implements them

Re: with-out-str assumes Unix line ends

2009-08-06 Thread ataggart
Anne, please don't threadjack. Now my original subject appears missing, since you renamed it. On Aug 6, 1:03 am, Anne Ogborn annie6...@yahoo.com wrote: (use 'clojure.contrib.duck-streams) (spit C:\\test.txt     (with-out-str       (println foo)       (println bar)       (flush))) On my

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread ataggart
Restoring this thread's original subject. On Aug 6, 10:40 am, ataggart alex.tagg...@gmail.com wrote: Anne, please don't threadjack.  Now my original subject appears missing, since you renamed it. On Aug 6, 1:03 am, Anne Ogborn annie6...@yahoo.com wrote: (use

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread ataggart
Ok, yes, I will blame my idiocy on sleep deprivation. In every case the name used by the log is the runtime *ns*, which really defeats the purpose of naming the specific usages of log. I'm surprised no one mentioned this (imo wrong) behavior. I'll get to work on fixing it so it behaves

Re: Transient Data Structures

2009-08-06 Thread Andy Fingerhut
On Aug 6, 4:53 am, Rich Hickey richhic...@gmail.com wrote: On Aug 5, 10:10 pm, Luc Prefontaine lprefonta...@softaddicts.ca wrote: I like this very much... that's the kind of clever optimizations that preserves Clojure principles and can yield significant performance increases. This

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread Richard Newman
In every case the name used by the log is the runtime *ns*, which really defeats the purpose of naming the specific usages of log. I'm surprised no one mentioned this (imo wrong) behavior. In my case, I don't see the namespace being printed in my log entries, so I wasn't even aware this

Re: Package manager proposal

2009-08-06 Thread Howard Lewis Ship
I'm cringing at the sight of XML here. (I almost through this post away when I read down and saw the work on Corkscrew but I thought some of my ideas might still be valid). What I'd like to see is something that execute *inside* Clojure, adding necessary libraries the classpath in some way: I

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread ataggart
Ah, very well. I find it useful to print out so I know which code is doing the logging, since stack inspection is very expensive, and in the case of clojure, looks like a mess of underscores and dollar signs. ;) On Aug 6, 12:31 pm, Richard Newman holyg...@gmail.com wrote: In every case the

a better reductions?

2009-08-06 Thread Stuart Halloway
Is the following an improvement on clojure.contrib.seq-utils/ reductions, or a step backwards? (defn my-reductions ([f coll] (if (seq coll) (cons (first coll) (my-reductions f (first coll) (rest coll))) (cons (f) nil))) ([f acc coll] (if (seq coll) (let

with-out-str assumes Unix line ends

2009-08-06 Thread Anniepoo
Sorry for the confusion - I read this list on an email feed. Turns out replying to a message from there and changing the subject isn't sufficient to start a new thread. Apparently it renames the thread. (suboptimal). original question: (use 'clojure.contrib.duck-streams) (spit C:\\test.txt

Re: a better reductions?

2009-08-06 Thread Sean Devlin
One more thought. I'd change the signature of the second call to [f init coll] This matches the original reductions. On Aug 6, 4:20 pm, Sean Devlin francoisdev...@gmail.com wrote: It seems to have the same signature, so as a consumer of the library it's the same to me.  If the speedup

Re: Package manager proposal

2009-08-06 Thread James Reeves
On Aug 6, 8:31 pm, Howard Lewis Ship hls...@gmail.com wrote: I'm cringing at the sight of XML here. XML is frequently overused, but it is a good format for representing dense, structured data. For example: repository name=third-party package name=Compojure href=/compojure.xml/ /repository

Re: Package manager proposal

2009-08-06 Thread James Reeves
On Aug 6, 10:16 pm, James Reeves weavejes...@googlemail.com wrote: (package/get compojure 0.2) (package/get clojure-contrib [:= 1.0-alpha3]) (ns example   (:use clojure.contrib.json.read)   (:use compojure.html)) I had another thought once after I posted. Perhaps the best of both syntax

Re: Clojure performance tests and clojure a little slower than Java

2009-08-06 Thread André Thieme
On 27 Jul., 23:26, AndyF andy_finger...@alum.wustl.edu wrote: Hello Andy, could you please update the following table?         |  sbcl  |  perl  |   ghc  |  java |   clj - mand-   | wrong  | out of |  32.7  |  28.6  | 340.4 elbrot  |

Re: gen-class not capturing the expected *ns*

2009-08-06 Thread ataggart
Restoring subject again On Aug 6, 12:48 pm, Anniepoo annie6...@yahoo.com wrote: Sorry for the confusion - I read this list on an email feed. Turns out replying to a message from there and changing the subject isn't sufficient to start a new thread. Apparently it renames the thread.

Re: Clojure performance tests and clojure a little slower than Java

2009-08-06 Thread Andy Fingerhut
On Aug 6, 3:28 pm, André Thieme splendidl...@googlemail.com wrote: On 27 Jul., 23:26, AndyF andy_finger...@alum.wustl.edu wrote: Hello Andy, could you please update the following table?         |  sbcl  |  perl  |   ghc  |  java |   clj

Re: Question about pmap

2009-08-06 Thread Andy Fingerhut
On Aug 6, 11:51 am, John Harrop jharrop...@gmail.com wrote: Cache misses are a possibility; try the integer version with long, so the size of the data is the same as with double. The other possibility I'd consider likely is that the JDK you were using implements caching in

Re: Package manager proposal

2009-08-06 Thread Howard Lewis Ship
Or really work this into core and add :packages to the (ns) macro. On Thu, Aug 6, 2009 at 2:30 PM, James Reevesweavejes...@googlemail.com wrote: On Aug 6, 10:16 pm, James Reeves weavejes...@googlemail.com wrote: (package/get compojure 0.2) (package/get clojure-contrib [:= 1.0-alpha3]) (ns

binding and bundles of variables

2009-08-06 Thread samppi
I have about six variables that are often rebound together using binding; these variables are used to access and set data in a state object (whose type is of the user's choice). These variables' values (the accessors and setters) are often used together. I'd like to be able to bundle these

Re: binding and bundles of variables

2009-08-06 Thread Meikel Brandmeyer
Hi, On Aug 7, 7:12 am, samppi rbysam...@gmail.com wrote: So is this possible without arcane stuff? Inhttp://groups.google.com/group/clojure/browse_thread/thread/23fe1a5c9..., I asked about using a macro to do this, and the consensus seems to be that it's possible with magic, but it's

Re: Package manager proposal

2009-08-06 Thread Laurent PETIT
Hello, Not a great contribution to the debate, but just a word on the terminology: reusing package which already has a strong meaning in java may not be a good idea, I think. I think lib or library could be interesting, but it has also been attributed a meaning more similar to ns description in