Problem with calling count on large lazy sequence?

2008-12-07 Thread [EMAIL PROTECTED]
I already posted this in another thread, but I think maybe it should have it's own now in light of new information. If you try to call count on a large lazy sequence you will get an OutOfMemoryError. For example I can evaluate the following expressions on a million line CSV file to reproduce

Re: Running out of memory when using filter?

2008-12-07 Thread rzeze...@gmail.com
On Dec 7, 1:52 am, Chouser [EMAIL PROTECTED] wrote: On Sun, Dec 7, 2008 at 1:16 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm also running into, what I believe to be, the same problem.  Every time I run the following code I get java.lang.OutOfMemoryError: Java heap space. (use

Re: memory issue with nth

2008-12-07 Thread Christian Vest Hansen
On Sun, Dec 7, 2008 at 7:18 AM, Paul Mooser [EMAIL PROTECTED] wrote: I also have this problem, unless I set my heap to be substantial - going up in increments of 128M, I need to have at least a 768M heap for this to not occur. That seems completely crazy, but the rest of you are saying you

Re: reduction

2008-12-07 Thread Rich Hickey
On Dec 7, 5:29 am, Christophe Grand [EMAIL PROTECTED] wrote: Chouser a écrit : Testing just now on large collections, the version using 'map' is indeed not only slower, but also overflows the stack. Hm... and perhaps I see why now. Is it computing the entire chain up to each result

Thanks for Clojure

2008-12-07 Thread [EMAIL PROTECTED]
I've been converting some projects to Clojure for the past few months, and I thought it was about time to say something about how much fun it is. I've nearly posted a couple of times about issues that cropped up, but thinking about them enough to express the issue clearly has so far always

Re: Clojure indentation conventions

2008-12-07 Thread [EMAIL PROTECTED]
On Dec 3, 3:06 pm, levand [EMAIL PROTECTED] wrote: I am coming to Clojure from the Java side, and am completely ignorant about lisp indentation newline conventions. Some things are easy to pick up from posted examples and common sense...newline + tab after the parameters vector when

Re: Clojure indentation conventions

2008-12-07 Thread [EMAIL PROTECTED]
On Dec 3, 3:06 pm, levand [EMAIL PROTECTED] wrote: I am coming to Clojure from the Java side, and am completely ignorant about lisp indentation newline conventions. Some things are easy to pick up from posted examples and common sense...newline + tab after the parameters vector when

A newbie question on Agents and ants

2008-12-07 Thread Matthew Wyatt
Hi all, I have a newbie question about Agents. I've been looking at the ants.clj file: http://clojure.googlegroups.com/web/ants.clj?hl=engda=-X7f3joAAABoLitVpBTEcNIQc_NHg39SZujXwZ5jF2pV4ArMqQ0G0e9OU0NQiFWgQuhmPR7veGf97daDQaep90o7AOpSKHW0 Most of it makes sense to me, but the use of Agents is

Re: neo4j-clojure

2008-12-07 Thread Marcus Dübois
Hi, first off I'd like to say that I'm new to Clojure and this list, I've just been using it for a day or so, but I really like what I'm seeing so far. Count me in! Not papers, but... Julian, I disagree with you on that point, but finding the papers may be a little difficult. We

Re: A newbie question on Agents and ants

2008-12-07 Thread Blaine
Have you checked out: http://clojure.blip.tv/file/812787? Clojure's author talks about agents and the other concurrency support mechanisms in Clojure. The latter half of the talk is a walk-through of the ant simulation. It's really good presentation. - Blaine On Dec 7, 12:56 am, Matthew

Non-NS-qualified hierarchies

2008-12-07 Thread Mibu
Is it possible to remove the asserts in derive that restrict the parent and child to namespace-qualified names? It would be much more useful if the asserts are moved to the global- hierarchy case ([child parent]) and the private hierarchies ([h child parent]) can do as they wish. Maybe ditch the

Re: Clojure Blogs | Yahoo Pipes | Clojure Pipe

2008-12-07 Thread Randall R Schulz
On Saturday 06 December 2008 20:59, Bill Clementson wrote: On Sat, Dec 6, 2008 at 2:11 PM, Randall R Schulz [EMAIL PROTECTED] wrote: ... Fascinating. Is that diagram generated by Yahoo! Pipes itself, or did you draw it? It's generated by Yahoo Pipes itself, not me. Yeah, I found

Re: Elegant but very slow

2008-12-07 Thread Peter Wolf
I'm a n00b, but isn't the point of this language to be *faster* than Java?... at least on a multiprocessor machine. Shouldn't the number of processors on the test machine make a big difference to how fast it runs? Whereas, the Java version is only dependent on the clock rate of the

Re: Elegant but very slow

2008-12-07 Thread Randall R Schulz
On Sunday 07 December 2008 07:11, Peter Wolf wrote: I'm a n00b, but isn't the point of this language to be *faster* than Java?... at least on a multiprocessor machine. I don't think performance is a particular criterion for the design of this language. It's not unimportant, but the quality of

clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Stuart Sierra
Hi folks, As of clojure-contrib SVN 283, there's a new clojure.contrib.test-is. This is a pretty major rewrite of the library. I've tried to streamline the code and make it easier to plug in custom reporting and assertion functions. Unfortunately, this introduces several breaking changes: 1.

Re: A newbie question on Agents and ants

2008-12-07 Thread Dave Newton
--- On Sun, 12/7/08, Michael Wood wrote: Is there an explanation that's a little smaller than 607MB? The slides and the code? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: A newbie question on Agents and ants

2008-12-07 Thread Michael Wood
On Sun, Dec 7, 2008 at 6:04 PM, Dave Newton [EMAIL PROTECTED] wrote: --- On Sun, 12/7/08, Michael Wood wrote: Is there an explanation that's a little smaller than 607MB? The slides and the code? :) Ah, sorry. Didn't see the slides link. -- Michael Wood [EMAIL PROTECTED]

Re: Elegant but very slow

2008-12-07 Thread Stephen C. Gilardi
On Dec 7, 2008, at 10:11 AM, Peter Wolf wrote: Shouldn't the number of processors on the test machine make a big difference to how fast it runs? Whereas, the Java version is only dependent on the clock rate of the individual processors. Replacing the map call with pmap on a 2 core machine

Inversion of Control vs. Laziness?

2008-12-07 Thread Randall R Schulz
Hi, I've been playing around with the Zipper code, partly to enhance it but mostly at this point to become competent with Clojure programming. One of the first things I tried to do was produce a pair of functions for doing both depth-first and breadth-first walks though a Zipper tree. I

Patch available: correction to line numbers in some exceptions thrown when loading

2008-12-07 Thread Stephen C. Gilardi
Clojure sometimes throws exceptions that report a line number of 0 when loading a file. This patch changes Compiler.java so the exceptions report the correct line number. Here's an example: A test directory containing two libs: % ls test a.clj b.clj test.a requires

Re: memory issue with nth

2008-12-07 Thread Paul Mooser
Is there a way to access the bytecode that a given expression compiles into? I'm curious if it would make it easier to file a bug report on the JVM on any affected platforms. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Emacs / Slime questions

2008-12-07 Thread Mark Engelberg
I'm using Clojure Box on Windows. It's working well for me, but I have a number of questions: 1. I see that you can use C-c C-c to feed the definition your cursor is on to the REPL. How do you feed the entire file to the REPL? 2. How do I restart the REPL, so that any definitions are erased

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Allen Rohner
In the mean time; I'm happy to hear about what you think, and any other improvements I could make to the library.  Some things I have in mind for the next version: 3. Adding test metadata to vars that are already defined elsewhere. I had a related idea the other night. I commonly like to

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Allen Rohner
One other feature idea: I'd like the ability to run individual tests. Once I've discovered a unit test failure, I want to be able to run the test by itself without the noise from other tests. Allen --~--~-~--~~~---~--~~ You received this message because you are

Re: Patch available: correction to line numbers in some exceptions thrown when loading

2008-12-07 Thread Michael Wood
Hi On Sun, Dec 7, 2008 at 9:13 PM, Stephen C. Gilardi [EMAIL PROTECTED] wrote: Clojure sometimes throws exceptions that report a line number of 0 when loading a file. This patch changes Compiler.java so the exceptions report the correct line number. See also this thread:

Re: Emacs / Slime questions

2008-12-07 Thread Bill Clementson
Hi Mark, I don't use Clojure Box or Windows; however, your questions relate mostly to Emacs/SLIME, so I've answered the ones I could below. Incidentally, all of these answers could have been found by reading the SLIME and/or Emacs documentation. On Sun, Dec 7, 2008 at 11:45 AM, Mark Engelberg

Re: Problem with calling count on large lazy sequence?

2008-12-07 Thread [EMAIL PROTECTED]
On Dec 7, 5:20 am, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, Am 07.12.2008 um 09:55 schrieb [EMAIL PROTECTED]: This solution worked for me and you can see my patch at the following url. http://paste.lisp.org/display/71744 This is of course no solution to the problem, but if you

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Stuart Sierra
On Dec 7, 2:51 pm, Allen Rohner [EMAIL PROTECTED] wrote: One other feature idea: I'd like the ability to run individual tests. Once I've discovered a unit test failure, I want to be able to run the test by itself without the noise from other tests. You can do that now with test-var, which

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Stuart Sierra
On Dec 7, 2:49 pm, Allen Rohner [EMAIL PROTECTED] wrote: An acceptable alternative would be to have a way to run all the tests in a namespace and all 'children' of a namespace. Then I could create a namespace like test.functional.db.foo test.functional.db.bar and then say (run-tests-recursive

Re: Patch available: correction to line numbers in some exceptions thrown when loading

2008-12-07 Thread Stephen C. Gilardi
On Dec 7, 2008, at 3:13 PM, Michael Wood wrote: With or without your patch I still get no line numbers for some things at the REPL. e.g. if I try to evaluate a non-existent symbol: $ java -cp clojure.jar clojure.main Clojure user= blah java.lang.Exception: Unable to resolve symbol: blah in

Re: Patch available: correction to line numbers in some exceptions thrown when loading

2008-12-07 Thread Michael Wood
On Sun, Dec 7, 2008 at 11:10 PM, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Dec 7, 2008, at 3:13 PM, Michael Wood wrote: With or without your patch I still get no line numbers for some things at the REPL. e.g. if I try to evaluate a non-existent symbol: $ java -cp clojure.jar

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread samppi
On Dec 7, 8:51 am, Stuart Sierra [EMAIL PROTECTED] wrote: 2. Nested test contexts, as in RSpec and some other testing frameworks. I would wholeheartedly love if tests could be nested. Even if it was as simple as appending a phrase to each nested test: (defcontext str-starts-with? (deftest

Re: slime+clojure problem

2008-12-07 Thread Peter Eddy
On Dec 3, 7:49 am, Dimitre Liotev [EMAIL PROTECTED] wrote: For example, my slime-lisp-implementations is:        (setq slime-lisp-implementations              `(                (sbcl (sbcl))                (ccl (ccl))                (clojure (clojure) :init swank-clojure-init)            

Re: linux, named pipe (fifo) and (while ...)

2008-12-07 Thread Randall R Schulz
On Sunday 07 December 2008 15:02, prhlava wrote: Hello everyone, I am trying to read (repeatedly) from named pipe (fifo) on linux (the program will be a long running process...). The following does not work, but if I remove the (while true , it does... Characterize does not work, if you

Re: linux, named pipe (fifo) and (while ...)

2008-12-07 Thread prhlava
The following does not work, but if I remove the (while true , it does... Characterize does not work, if you would. Well, nothing happens with (while around the code... But if I take the while out, and run the remaining code, it does what expected - prints the content of the buffer (once,

Re: linux, named pipe (fifo) and (while ...)

2008-12-07 Thread Randall R Schulz
On Sunday 07 December 2008 15:45, prhlava wrote: The following does not work, but if I remove the (while true , it does... Characterize does not work, if you would. Well, nothing happens with (while around the code... But if I take the while out, and run the remaining code, it does

Re: Thanks for Clojure

2008-12-07 Thread Mon Key
I've been converting some projects to Clojure for the past few months... but thinking about them enough to express the issue clearly has so far always resulting in my solving them easily. This is GREAT to hear. I personally place considerable measure on accounts such as yours because they

Re: linux, named pipe (fifo) and (while ...)

2008-12-07 Thread prhlava
You're asking for the pipe to be repeatedly opened, one uninterrupted glob of bytes read and processed and then the pipe closed. Is that really what you intend? Yes, that was my intention, maybe a rethink is in order... As written, this suggest a kind of daemon that monitors the pipe,

Re: linux, named pipe (fifo) and (while ...)

2008-12-07 Thread Randall R Schulz
Vlad, On Sunday 07 December 2008 16:12, prhlava wrote: You're asking for the pipe to be repeatedly opened, one uninterrupted glob of bytes read and processed and then the pipe closed. Is that really what you intend? Yes, that was my intention, maybe a rethink is in order... As

Re: Patch available: correction to line numbers in some exceptions thrown when loading

2008-12-07 Thread Timothy Pratley
Your patch does fix the problem in Timothy's first post in that thread, though. Not fully... it can still be defeated by: (let [l nil] (.accept l) What I found when examining this previously was that the exception is thrown from Relfector.java Which is invoked from Complier.java: FnExpr

Re: Emacs / Slime questions

2008-12-07 Thread Mark Engelberg
Thanks for all the info. I've searched my whole hard drive for a .emacs file, and can't find one. Can someone tell me where Clojure Box stores this file, or whether it's called something entirely different? --Mark --~--~-~--~~~---~--~~ You received this message

Re: Another build.xml patch for contrib

2008-12-07 Thread Stefan Bodewig
On 2008-12-05, Meikel Brandmeyer [EMAIL PROTECTED] wrote: Hi, Am 05.12.2008 um 14:40 schrieb Stefan Bodewig: BUILD FAILED /Users/gj/site/clojure/clojure-contrib/build.xml:62: The jar type doesn't support the nested path element. That was added in Ant 1.7.0, released two years ago.