Re: Why no def- ?

2011-01-20 Thread Ken Wesson
On Fri, Jan 21, 2011 at 12:40 AM, Alex Baranosky wrote: > I've wanted to have private defs.  For defn, I just us defn-.  But there is > no def- > > So I just use: > > (defmacro def- [name & decls] >     (list* `def (with-meta name (assoc (meta name) :private true)) decls)) There's a (defvar- ...)

Why no def- ?

2011-01-20 Thread Alex Baranosky
I've wanted to have private defs. For defn, I just us defn-. But there is no def- So I just use: (defmacro def- [name & decls] (list* `def (with-meta name (assoc (meta name) :private true)) decls)) -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: Euler 14

2011-01-20 Thread Ken Wesson
FWIW, no heap error on my system (Clojure 1.2, Java 1.6.0_13 -server). -- 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 wit

Re: Euler 14

2011-01-20 Thread Mark Engelberg
On Thu, Jan 20, 2011 at 6:51 AM, Andreas Liljeqvist wrote: > I am sorry, I can't seem to reproduce the behavior at the moment :( > Mark, please tell me that I am not delusional... I definitely exhausted the heap running your program. I was using Clojure 1.1, Java 1.6.0_21 with -server -Xmx1600M

Re: Problem with lazy-seq and heap space overflow

2011-01-20 Thread Ken Wesson
On Thu, Jan 20, 2011 at 10:30 PM, gaz jones wrote: > interesting... the changes i suggested cause it to get the first 3 > values in around 300ms on my machine and dont blow the heap O_o Yes; I'm not sure why but the lazy-seq version is significantly faster than iterate, though the latter is inter

Re: Problem with lazy-seq and heap space overflow

2011-01-20 Thread gaz jones
interesting... the changes i suggested cause it to get the first 3 values in around 300ms on my machine and dont blow the heap O_o On Thu, Jan 20, 2011 at 8:38 PM, Ken Wesson wrote: > My suspicion is that > > (lazy-seq ... (map rest seqs)) > > in closing over seqs causes the heads of the seqs to

Re: Problem with lazy-seq and heap space overflow

2011-01-20 Thread Ken Wesson
My suspicion is that (lazy-seq ... (map rest seqs)) in closing over seqs causes the heads of the seqs to be held during the recur iteration. When the third value is as big as 1533776805, the recur iteration is realizing lengthy portions of the seqs downstream. The problem with this is that the l

Re: Grabbing Rotten Tomatoes movie ratings in clojure

2011-01-20 Thread justinhj
Interesting. Enliven looks way more concise for this sort of thing. Justin On Jan 20, 11:26 am, Anders Rune Jensen wrote: > You might have a look at this code I wrote a while ago: > > https://mocomp.googlecode.com/hg/rotten-tomatoes.clj > > It's written using enlive :) I'm using google to search

Re: Getting started with Counterclockwise

2011-01-20 Thread Rayne
Hi Mr. Bell, allow me to introduce you to Mr. Sarcasm. :p On Jan 20, 9:32 am, Peter Bell wrote: > On Jan 20, 2011, at 9:34 AM, Laurent PETIT wrote: > > > 2011/1/20 Aaron Bedra > > > Clojure/core > >http://clojure.comcl > > >  the url of the website below your "title" does not work. > > http://cl

Re: Problem with lazy-seq and heap space overflow

2011-01-20 Thread gaz jones
try this: (defn equal-values [seqs] "Given a list of ascending sequences, returns a lazy sequence containing only values that exist in all of the sequences." (lazy-seq (if (empty? (first seqs)) [] (let [first-values (map first seqs)] (if (apply = first-values) (cons (fir

Problem with lazy-seq and heap space overflow

2011-01-20 Thread Marek Stępniowski
Hi, I'm Marek Stępniowski, a Python developer trying to learn a new language by night. I'm new to this group. When solving problem 45 from Project Euler [1] I have tried to learn how lazy-seq macro should be used and wrote the code below:: (defn pentagonal-numbers [] (map #(* 1/2 % (dec (* 3 %))

Re: which IDEs are you all using?

2011-01-20 Thread Mark Engelberg
Clojurebox is easier to install, and when you run it, it automatically connects up to a REPL so it's ready to go. I find it harder to configure the classpath for individual projects, and do other things that leverage the full power of emacs. On Thu, Jan 20, 2011 at 3:51 AM, Abraham wrote: > new

Re: Getting started with Counterclockwise

2011-01-20 Thread Ken Wesson
On Thu, Jan 20, 2011 at 3:14 PM, ka wrote: > I've been using ccw for a while now and it works perfectly as > advertised. Plus the new 0.2.0 version looks to be really promising. I > invite all ccw users to give their inputs. > > What's bugging is not that you faced a problem or that ccw didn't wor

Re: Getting started with Counterclockwise

2011-01-20 Thread ka
I've been using ccw for a while now and it works perfectly as advertised. Plus the new 0.2.0 version looks to be really promising. I invite all ccw users to give their inputs. What's bugging is not that you faced a problem or that ccw didn't work as you expected, what's disturbing is how you react

Re: Grabbing Rotten Tomatoes movie ratings in clojure

2011-01-20 Thread Anders Rune Jensen
You might have a look at this code I wrote a while ago: https://mocomp.googlecode.com/hg/rotten-tomatoes.clj It's written using enlive :) I'm using google to search, sadly the google ajax api returns different results than "normal" google and they are not to keen on being hammered (fair warning ;

Re: Most Elegant Clojure Solution For Wilson's Maze Algorithm

2011-01-20 Thread Conrad
Oh yeah, here is the blog post: http://weblog.jamisbuck.org/2011/1/20/maze-generation-wilson-s-algorithm/comments/8627#comment-8627 -- 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

Most Elegant Clojure Solution For Wilson's Maze Algorithm

2011-01-20 Thread Conrad
Hi guys- I saw this neat blog post today on Wilson's algorithm. I think it is a great algorithm for learning how to write clean code with the latest 1.2 or 1.3 core libraries. To start off, here is my solution: http://clojure.pastebin.com/dd5ccDkP I'd love to see what the rest of you can do to imp

Re: Getting started with Counterclockwise

2011-01-20 Thread Aaron Bedra
On 01/20/2011 10:15 AM, Ken Wesson wrote: On Thu, Jan 20, 2011 at 9:31 AM, Luc Prefontaine wrote: Chasing a fly with a news paper has more value than spending time with you for any purpose. ... Oups, need to flush that junk folder again... crap appeared in it again. And some people are cla

Re: Getting started with Counterclockwise

2011-01-20 Thread Peter Bell
On Jan 20, 2011, at 9:34 AM, Laurent PETIT wrote: > 2011/1/20 Aaron Bedra > > Clojure/core > http://clojure.comcl > > the url of the website below your "title" does not work. http://clojure.com I don't think it's that hard to figure out. Personally, I'd rather he continue to add cool featur

Re: Getting started with Counterclockwise

2011-01-20 Thread Ken Wesson
On Thu, Jan 20, 2011 at 9:31 AM, Luc Prefontaine wrote: > Chasing a fly with a news paper has more value than spending time > with you for any purpose. ... > Oups, need to flush that junk folder again... crap appeared in it > again. And some people are claiming that *I* am being trollish, churli

Re: Euler 14

2011-01-20 Thread Andreas Liljeqvist
I am sorry, I can't seem to reproduce the behavior at the moment :( Mark, please tell me that I am not delusional... Will try at home also. 2011/1/20 ka > Andreas, How are you running that? Also what do you see in the heap > dump and what is the jvm heap size? > > -- > You received this message

Re: ANN: Textmash - another IDE for Clojure

2011-01-20 Thread Jeff Rose
I'd also be interested in clojure paredit as a library. We've been talking about having a stripped down editor for defining synthesizers and musical processes inside of Overtone, so some tools to get a useful little Clojure editing window would be great. -Jeff On Jan 19, 10:44 am, Laurent PETIT

Re: Getting started with Counterclockwise

2011-01-20 Thread Aaron Bedra
Yep, just fixed that :) Cheers, Aaron Bedra -- Clojure/core http://clojure.com On 01/20/2011 09:36 AM, Laurent PETIT wrote: Seriously, Aaron, there's a typo in your signature. Take care ;) -- Laurent -- You received this message because you are subscribed to the Google Groups "Clojure" group

Re: Getting started with Counterclockwise

2011-01-20 Thread Laurent PETIT
Seriously, Aaron, there's a typo in your signature. Take care ;) -- Laurent -- 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 pat

Re: Getting started with Counterclockwise

2011-01-20 Thread Laurent PETIT
2011/1/20 Aaron Bedra Dropped a lot of raaather ininteresting stuff > > Cheers, > > Aaron Bedra > -- > Clojure/core > http://clojure.comcl > > Aaron, >From your signature, where I see "Clojure/core", I thought that you were maybe a core member of the clojure community. But how laaame are y

Re: Getting started with Counterclockwise

2011-01-20 Thread Luc Prefontaine
Issuing threats against you ? Chasing a fly with a news paper has more value than spending time with you for any purpose. You clearly do not understand what a lot of people have been telling you in different ways. Ignoring you is a much more rational use of my time. Others should come to the sam

Re: Getting started with Counterclockwise

2011-01-20 Thread Ken Wesson
On Thu, Jan 20, 2011 at 8:46 AM, Laurent PETIT wrote: > 2011/1/20 Ken Wesson >> >> On Wed, Jan 19, 2011 at 9:39 AM, Rayne wrote: >> > Aren't you a developer? >> >> I'm not a CCW developer. >> >> > If a code.google link is the top of google results, that's what I'm >> > going to click and check o

Re: Getting started with Counterclockwise

2011-01-20 Thread Aaron Bedra
You have been asked kindly to change your tone. Are you implying a threat? The next part of your post seemed to descend into name-calling, more threats, and other unconstructive material, so I did not bother to read further. Have a good day. Nobody is implying any threats. They are simply

Re: Getting started with Counterclockwise

2011-01-20 Thread Laurent PETIT
2011/1/20 Ken Wesson > On Wed, Jan 19, 2011 at 9:39 AM, Rayne wrote: > > Aren't you a developer? > > I'm not a CCW developer. > > > If a code.google link is the top of google results, that's what I'm > > going to click and check out first. code.google is a project hosting > > site, not just a pl

Re: Getting started with Counterclockwise

2011-01-20 Thread Ken Wesson
On Wed, Jan 19, 2011 at 9:56 AM, Luc Prefontaine wrote: > Not reading wiki pages available, not investigating available links > about ccw are more a sign of mental laziness than anything else or > some form of disdain. Or, they can be a sign of not having been pointed to the links by the install

Re: Getting started with Counterclockwise

2011-01-20 Thread Ken Wesson
On Wed, Jan 19, 2011 at 9:39 AM, Rayne wrote: > Aren't you a developer? I'm not a CCW developer. > If a code.google link is the top of google results, that's what I'm > going to click and check out first. code.google is a project hosting > site, not just a place to throw up code and developer di

Re: Euler 14

2011-01-20 Thread ka
Andreas, How are you running that? Also what do you see in the heap dump and what is the jvm heap size? -- 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

Re: Problem with garbage collection? Was Euler 14

2011-01-20 Thread Ken Wesson
On Thu, Jan 20, 2011 at 5:04 AM, Andy Fingerhut wrote: > I would recommend that anyone who publishes their results running this code > specify what OS, JVM, and version of Clojure they are using.  I don't know > yet whether OS and JVM version make any difference, but at least on Ubuntu > 10.4 Linu

Re: Overriding a java protected method and calling the super-class method from within

2011-01-20 Thread .Bill Smith
There may be others, but one way to do it is to the Java reflection API to call the super class method through its Method object. Bill -- 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

Re: Euler 14

2011-01-20 Thread Andreas Liljeqvist
Thank you, that explains the failure of the lazy-cseq using top-level defs. I really hope it gets fixed, Clojure is going to be a hard sell if I have to explain things like this to my coworkers :( Anyhow there is still the problem with nonlazy cseq blowing the heap. (defn cseq [n] (if (= 1 n)

Re: almost as dosec

2011-01-20 Thread David Powell
On Thu 20/01/11 13:06 , kony kulakow...@gmail.com sent: > Hi, > > I am looking for something which operates similarly as doseq but in > case of more than one binding traverses every sequence only one. I.e. > > wanted result: > > (doseq [x '(A B C) y '(1 2 3)] (println (list x y))) > > should

Re: Regarding The Implementation of 'merge-with'

2011-01-20 Thread Stefan Rohlfing
Hi John, Thanks for your detailed explanation of the inner workings of my code! I have been confused by the behavior of Clojure's mutable data structures quite often, but after reading your explanation it finally starts to make sense. I also tried to explain why your code works: Everything

Re: almost as dosec

2011-01-20 Thread Ken Wesson
On Thu, Jan 20, 2011 at 8:06 AM, kony wrote: > Hi, > > I am looking for something which operates similarly as doseq but in > case of more than one binding traverses every sequence only one. I.e. > > wanted result: > > (doseq [x '(A B C) y '(1 2 3)] (println (list x y))) > > should produce: > > (A

Re: almost as dosec

2011-01-20 Thread Sunil S Nandihalli
sorry .. I was too quick in responding .. You are talking about something else.. Sunil. On Thu, Jan 20, 2011 at 6:40 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > one of the following should give you a reasonable solution > http://clojuredocs.org/clojure_contrib/clojure.contrib.se

Re: almost as dosec

2011-01-20 Thread Sunil S Nandihalli
one of the following should give you a reasonable solution http://clojuredocs.org/clojure_contrib/clojure.contrib.seq/indexed http://clojuredocs.org/clojure_core/clojure.core/map-indexed

almost as dosec

2011-01-20 Thread kony
Hi, I am looking for something which operates similarly as doseq but in case of more than one binding traverses every sequence only one. I.e. wanted result: (doseq [x '(A B C) y '(1 2 3)] (println (list x y))) should produce: (A 1) (B 2) (C 3) OK I know that in this particular case there are

Re: just an observation about doseq...

2011-01-20 Thread John Szakmeister
On Thu, Jan 20, 2011 at 5:38 AM, Baishampayan Ghose wrote: >>> when we give an empty vector of seq-exprs to doseq it returns the value of >>> the last s-expression.. but returns nil when the >>> vector-of-seq-exprs is not empty.. may be this is the expected behaviour .. >>> but the documentation s

Overriding a java protected method and calling the super-class method from within

2011-01-20 Thread László Török
Hi, I am quite new to clojure and in the process of sharpening my skills. I bumped into an interop problem: I have a Java concrete class A that has a protectedMethod(parameter). I'd like to wrap the method, but also call the one defined in the super class. I found that (proxy ..) is no good for

Re: which IDEs are you all using?

2011-01-20 Thread Abraham
new to Emacs Ide . How Clojurebox differs from Emacs ? Which will be better to get full power of emacs Thanks Mark Engelberg wrote: > On Wed, Jan 12, 2011 at 9:56 AM, Philip Hudson wrote: > > I have something like this: > > > > (setq desktop-dirname "/foo/bar" > >      desktop-path    '("/foo/b

Re: which IDEs are you all using?

2011-01-20 Thread Laurent PETIT
2011/1/20 Sergey Didenko > "lein": I just use "lein new MyProject" then "lein pom" and open the pom in > Netbeans. Thus I have both lein and Enclojure. The drawback is that you have > to run "lein pom" every time you change the project dependencies (in the > lein project.clj). > Have not tried t

Re: just an observation about doseq...

2011-01-20 Thread Baishampayan Ghose
>> when we give an empty vector of seq-exprs to doseq it returns the value of >> the last s-expression.. but returns nil when the >> vector-of-seq-exprs is not empty.. may be this is the expected behaviour .. >> but the documentation states otherwise .. > > Yeah, that looks like a bug (either in th

Re: just an observation about doseq...

2011-01-20 Thread Sunil S Nandihalli
yea true, I guess it is harmless though .. but a bug nevertheless... On Thu, Jan 20, 2011 at 2:06 PM, John Szakmeister wrote: > On Thu, Jan 20, 2011 at 1:02 AM, Sunil S Nandihalli > wrote: > > Hello everybody, > > when we give an empty vector of seq-exprs to doseq it returns the value > of > > t

Re: Euler 14

2011-01-20 Thread Andy Fingerhut
David: Here is a link to the exact source code of the program I was running for my recently published results in the sister thread titled "Problem with garbage collection? Was Euler 14". https://github.com/jafingerhut/clojure-benchmarks/blob/master/collatz/collatz.clj-1.clj Is this code al

Re: Regarding The Implementation of 'merge-with'

2011-01-20 Thread John Szakmeister
On Thu, Jan 20, 2011 at 3:34 AM, Stefan Rohlfing wrote: > Hi John, > Thank you very much for your correction of my code! my-merge-with is working > perfectly now. > There is just one thing: I always want to understand my errors so that I can > learn from them. However, I still don't understand why

Re: Euler 14

2011-01-20 Thread David Powell
This same problem was raised recently: https://groups.google.com/group/clojure/browse_thread/thread/df4ae16ab0952786?tvc=2&q=memory It isn't a GC problem, it is an issue in the Clojure compiler. The issue seems to only affect top-level defs. At the top-level: (reduce + (range 1000)) -

Re: Problem with garbage collection? Was Euler 14

2011-01-20 Thread Andy Fingerhut
I would recommend that anyone who publishes their results running this code specify what OS, JVM, and version of Clojure they are using. I don't know yet whether OS and JVM version make any difference, but at least on Ubuntu 10.4 Linux, the 64-bit version, and Sun/Oracle's Hotspot 1.6.0_22

Re: just an observation about doseq...

2011-01-20 Thread John Szakmeister
On Thu, Jan 20, 2011 at 1:02 AM, Sunil S Nandihalli wrote: > Hello everybody, > when we give an empty vector of seq-exprs to doseq it returns the value of > the last s-expression.. but returns nil when the > vector-of-seq-exprs is not empty.. may be this is the expected behaviour .. > but the docu

Re: Regarding The Implementation of 'merge-with'

2011-01-20 Thread Stefan Rohlfing
Hi John, Thank you very much for your correction of my code! *my-merge-with* is working perfectly now. There is just one thing: I always want to understand my errors so that I can learn from them. However, I still don't understand why my implementation did not work. Looking at my code I am thi

Re: Euler 14

2011-01-20 Thread ka
>> Running in VisualVM suggests that % of Used Heap is actually very >> less. So the problem is that GC isn't running often enough, so the JVM >> has to keep allocating more memory. By problem I meant, in my case, of too much memory consumption. > Odd. I'd expect the JVM to run a GC immediately

Re: Regarding The Implementation of 'merge-with'

2011-01-20 Thread John Szakmeister
On Wed, Jan 19, 2011 at 11:23 PM, Stefan Rohlfing wrote: > Hi all, > > I tried another implementation of 'merge-with' using nested calls to > 'reduce'. However, > I just cannot get it to work correctly: > > (defn my-merge-with [f & maps] >  (when (some identity > maps) >    (reduce >     (fn [acc