Re: which IDEs are you all using?

2011-01-19 Thread 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). "Loosing settings": I observed that too in rare circu

Re: Enclojure requires editor when installing plugin

2011-01-19 Thread Sergey Didenko
I use it with Netbeans 6.9.1 . Usually it takes some time for Enclojure to be adapted to the latest Netbeans. -- 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 member

Re: Vararg in protocol methods

2011-01-19 Thread Alan
Protocols don't support varargs. You've defined a protocol with two methods named say: one takes one argument named a, the other takes three arguments named a, &, and b. Protocols are for describing a very minimal set of functionality needed to implement some richer feature set; the idea is that y

just an observation about doseq...

2011-01-19 Thread Sunil S Nandihalli
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 documentation states otherwise .. Sunil. -- You received this message

Re: Metadata on symbols differ with caret reader

2011-01-19 Thread Tim Robinson
I upgraded lein from 1.3.1 to 1.4.2, which fixed the problem. :) On Jan 10, 6:47 am, Stefan Kamphausen wrote: > Hi, > > I can't verify that a REPL created by lein behaves differently.  Did you > perhaps update an old project.el without running lein deps? > > In addition to that: your defproject h

Re: Regarding The Implementation of 'merge-with'

2011-01-19 Thread Stefan Rohlfing
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 m] (reduce (fn [_ [key val]] (assoc acc key (if-le

Vararg in protocol methods

2011-01-19 Thread dennis
I have defined a protocol with overload methods,and one has varargs: (ns test) (defprotocol Say (say [this a] [this a & b] "say hello")) (defrecord Robot [] Say (say [this a] (println (str "hello," a))) (say [this a & b] (println b))) Then ,i new a robot and say something: (let [ r (Robo

Re: Euler 14

2011-01-19 Thread Mark Engelberg
On Wed, Jan 19, 2011 at 6:48 PM, ka wrote: > 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. Odd. I'd expect the JVM to run a GC immediately before reporting that the

Re: Euler 14

2011-01-19 Thread ka
To me this looks totally fine, max-key should keep at most two sequences in memory. I don't think there should be any difference between the non-lazy and lazy versions as the depth of cseq is ~500. The non-lazy version works for me (no heap error) for inputs 1M, 2M, 4M, but for 4M the java process

Re: Problem with garbage collection? Was Euler 14

2011-01-19 Thread Paul Mooser
That completes without giving me any error. I'm using clojure 1.2.0 on OS X 10.6.6, and the JVM is 1.6.0_22. On Jan 19, 1:42 am, Andreas Liljeqvist wrote: > Reposting this from earlier mail about Euler 14. > > (defn cseq [n] >   (if (= 1 n) >     [1] >     (cons n (cseq (if (even? n) >          

Re: Leiningen and apache commons

2011-01-19 Thread Andreas Kostler
Hi, thanks for your reply. I was missing a .telnet in my import :( Noobness struck again! Andreas On 20/01/2011, at 11:06 AM, Luc Prefontaine wrote: > You need to import the classes from that library and then wrap them up > with some Clojure code. > > Here a snippet: > > (ns myname.space > (

Re: Leiningen and apache commons

2011-01-19 Thread Luc Prefontaine
You need to import the classes from that library and then wrap them up with some Clojure code. Here a snippet: (ns myname.space (:import (org.apache.commons.logging LogFactory Log)) ;; Import from commons-logging the LogFactory and Log classes ) ... ;; ;; Get a logger for the current na

Re: best way to define alias for all publics in ns?

2011-01-19 Thread Seth
The core actually wouldn't have to be modified, as it already does something similar. After all, the function 'use' already does it - if we 'use' error-kit, it adds to the symbol map (seen by (ns-refers *ns*)) a map from the symbol to the actual var in error-kit. Thus, in ns A where we have used er

Leiningen and apache commons

2011-01-19 Thread Andreas Kostler
Hi All, Can someone please tell me how to import the Apache commons net library? I'm using leiningen. The project.clj looks like this: (defproject clojure-scheme "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.2.0"] [org.clojure/clojure-contr

Re: Grabbing Rotten Tomatoes movie ratings in clojure

2011-01-19 Thread Mark Nutter
Let me also recommend swannodette's excellent Enlive tutorial: https://github.com/swannodette/enlive-tutorial It's a great way to jump into the meat and potatoes. m On Tue, Jan 18, 2011 at 7:05 PM, justinhj wrote: > Thanks for the feedback Stuart > > I'll check out Enliven. I'm currently writi

Re: ANN: Textmash - another IDE for Clojure

2011-01-19 Thread Nathan Sorenson
I've always wanted to have an in-game scripting console that has access to some of the functionality I'm used to in emacs, like paredit. This would actually be really useful in achieving this, I think! On Jan 19, 1:44 am, Laurent PETIT wrote: > Hello, > > 2011/1/18 Olek > > > Hi, > > > Here is a

Re: slow mysql inserts

2011-01-19 Thread Michael Ossareh
On Wed, Jan 19, 2011 at 09:15, rygorr wrote: > This was it. The overhead was in creating the handle. > > I can't remember who told me this: "Always blame the network". In finer detail, the conversation was about things that use the network and are so very much slower than you anticipate. -- Y

Re: slow mysql inserts

2011-01-19 Thread rygorr
This was it. The overhead was in creating the handle. When I moved the doseq inside the with-connection it solved the problem. Thanks On Jan 19, 2011, at 7:24 AM, Meikel Brandmeyer wrote: > Hi, > > On 18 Jan., 19:32, rygorr wrote: > >> (doseq [x (range 2000)] >> (with-connection db >>

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Adam
There appears to be a bug in "walk" when there is an empty folder somewhere beneath the specified directory. I've only tested this on Win XP but this triggers a NullPointerException on fs 0.4.0: (walk "c:/empty" (fn [& a] true)) No message. [Thrown class java.lang.NullPointerException] Re

Re: Problem with garbage collection? Was Euler 14

2011-01-19 Thread Andreas Liljeqvist
user> (defn cseq [n] (if (= 1 n) [1] (lazy-seq (cons n (cseq (if (even? n) (/ n 2) (+ (* 3 n) 1 ))) #'user/cseq user> (count (apply max-key count (map cseq (range 1 100 525 user> (first (apply max-key count (map cseq (range 1 100 83

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Miki
> > I have one question, is there any documentation available for the > functions provided by fs? I would love a place where I could go to scan > the available functions, other than the source code. > https://bitbucket.org/tebeka/fs/src -- You received this message because you are subscribed t

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Meikel Brandmeyer
Hi, Am 19.01.2011 um 21:24 schrieb B Smith-Mannschott: > This is a retarded 'convention', and it isn't really much of a > convention at that. Just because Clojure itself has a 'core.clj', > doesn't mean everyone else needs one now too. I blame Leiningen's > defaults. For counter-examples, take a

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread B Smith-Mannschott
On Wed, Jan 19, 2011 at 15:30, Rayne wrote: > It isn't nearly as big a deal as you think it is. I'm guessing you have a > single file called 'fs.clj' with the namespace 'fs', right? > mkdir src/fs/ > mv src/fs.clj src/fs/core.clj > > and then edit the file and change the namespace to fs.core. Why

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Eric Schulte
Miki writes: >> It isn't nearly as big a deal as you think it is. I'm guessing you have a >> single file called 'fs.clj' with the namespace 'fs', right? >> >> mkdir src/fs/ >> mv src/fs.clj src/fs/core.clj >> > and then edit the file and change the namespace to fs.core. > > I know it's easy to

Re: Testing if a sequence is lazy

2011-01-19 Thread Chouser
On Tue, Jan 18, 2011 at 12:22 AM, Nick Brown wrote: > Hi, I'm wondering if there is a good way to test if a given sequence > is lazy, and if so, how much of it has been evaluated.  I know the > fact that it is lazy should be transparent, but I'm thinking in the > context of unit testing knowing th

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Miki
> It isn't nearly as big a deal as you think it is. I'm guessing you have a > single file called 'fs.clj' with the namespace 'fs', right? > > mkdir src/fs/ > mv src/fs.clj src/fs/core.clj > and then edit the file and change the namespace to fs.core. > I know it's easy to do, I just don't think

Re: Problem with garbage collection? Was Euler 14

2011-01-19 Thread Miki
> (defn cseq [n] > (if (= 1 n) > [1] > (cons n (cseq (if (even? n) > (/ n 2) > (+ (* 3 n) 1 )) > > (apply max-key count (map cseq (range 1 100))) > > Gives a heap error. > cseq is at most 525 elements long. > The solution is much more than 525 (> 80).

Re: Getting started with Counterclockwise

2011-01-19 Thread Laurent PETIT
2011/1/19 Luc Prefontaine > Ken, > > It's always easy to complain and you seem excellent at it. > However, to investigate any problem, hard facts are needed to > support the fixing process. > > There are little facts reported in your emails about the problems you > experienced according to you re

Re: slow mysql inserts

2011-01-19 Thread Meikel Brandmeyer
Hi, On 18 Jan., 19:32, rygorr wrote: > (doseq [x (range 2000)] >     (with-connection db >        (insert-values :test >                       [:value] [x]))) > db is the com.mysql.jdbc.Driver connection string. Move the with-connection outside the doseq. (with-connection db (doseq [x (range

Re: slow mysql inserts

2011-01-19 Thread Christian Vest Hansen
I suspect that ClojureQL and with-connection are opening and closing the connection for every query, whereas the Java and Perl versions are reusing their connections. Try adding a connection pool to the mix. On Tue, Jan 18, 2011 at 19:32, rygorr wrote: > I'm currently doing some preliminary perf

Re: Getting started with Counterclockwise

2011-01-19 Thread Baishampayan Ghose
> I'm big, mean and I hate prima donnas. You would not even try to use that > tone with a guy like me. I can vouch for that! Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: Getting started with Counterclockwise

2011-01-19 Thread Luc Prefontaine
Ken, It's always easy to complain and you seem excellent at it. However, to investigate any problem, hard facts are needed to support the fixing process. There are little facts reported in your emails about the problems you experienced according to you regarding ccw. Not reading wiki pages avail

Re: Getting started with Counterclockwise

2011-01-19 Thread Rayne
Aren't you a developer? I am. I think everybody else here is as well. 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 discussion. It offers wiki services, d

Re: [ANN] fs - file system utilities for Clojure

2011-01-19 Thread Rayne
It isn't nearly as big a deal as you think it is. I'm guessing you have a single file called 'fs.clj' with the namespace 'fs', right? mkdir src/fs/ mv src/fs.clj src/fs/core.clj and then edit the file and change the namespace to fs.core. Why is that such a big deal? I understand that you're c

Re: best way to define alias for all publics in ns?

2011-01-19 Thread Laurent PETIT
2011/1/19 Ken Wesson > On Wed, Jan 19, 2011 at 8:49 AM, Laurent PETIT > wrote: > > 2011/1/19 Ken Wesson > >> On Wed, Jan 19, 2011 at 4:06 AM, Laurent PETIT > > >> wrote: > >> > 2011/1/18 Ken Wesson > >> >> On Tue, Jan 18, 2011 at 1:07 PM, Stuart Sierra > >> >> wrote: > >> >> > You're not rea

Re: best way to define alias for all publics in ns?

2011-01-19 Thread Ken Wesson
On Wed, Jan 19, 2011 at 8:49 AM, Laurent PETIT wrote: > 2011/1/19 Ken Wesson >> On Wed, Jan 19, 2011 at 4:06 AM, Laurent PETIT >> wrote: >> > 2011/1/18 Ken Wesson >> >> On Tue, Jan 18, 2011 at 1:07 PM, Stuart Sierra >> >> wrote: >> >> > You're not really aliasing the Vars, you're creating new

Re: best way to define alias for all publics in ns?

2011-01-19 Thread Laurent PETIT
2011/1/19 Ken Wesson > On Wed, Jan 19, 2011 at 4:06 AM, Laurent PETIT > wrote: > > 2011/1/18 Ken Wesson > >> > >> On Tue, Jan 18, 2011 at 1:07 PM, Stuart Sierra > >> wrote: > >> > You're not really aliasing the Vars, you're creating new Vars and > >> > copying > >> > the root values from the o

Re: Getting started with Counterclockwise

2011-01-19 Thread Ken Wesson
On Wed, Jan 19, 2011 at 5:13 AM, Laurent PETIT wrote: > > > 2011/1/18 Ken Wesson >> >> On Tue, Jan 18, 2011 at 1:14 PM, Chas Emerick >> wrote: >> > Any tone you might have picked up from Laurent might be a reaction to >> > your ranting about how ccw is apparently rubbish rather than asking for >

Re: Code Review of my first stab

2011-01-19 Thread Tim Visher
Thanks for everyone's feedback. Sound like the code, in general, is basically right. Probably some of the issues that I'm having with the code comes from simply not being terribly familiar with reading clojure code. -- You received this message because you are subscribed to the Google Groups "Clo

Problem with garbage collection? Was Euler 14

2011-01-19 Thread Andreas Liljeqvist
Reposting this from earlier mail about Euler 14. (defn cseq [n] (if (= 1 n) [1] (cons n (cseq (if (even? n) (/ n 2) (+ (* 3 n) 1 )) (apply max-key count (map cseq (range 1 100))) Gives a heap error. cseq is at most 525 elements long. 2011/1/17 Mark E

Re: best way to define alias for all publics in ns?

2011-01-19 Thread Ken Wesson
On Wed, Jan 19, 2011 at 4:06 AM, Laurent PETIT wrote: > 2011/1/18 Ken Wesson >> >> On Tue, Jan 18, 2011 at 1:07 PM, Stuart Sierra >> wrote: >> > You're not really aliasing the Vars, you're creating new Vars and >> > copying >> > the root values from the originals. >> > This leads to subtle bugs

Re: Code Review of my first stab

2011-01-19 Thread Chas Emerick
On Jan 18, 2011, at 8:54 PM, Lee Spector wrote: > Also BTW I saw no clear performance improvement (relative to the overall > runtime of my system); some numbers on that are also below. A perf differential will be seen if slot access is a significant portion of the algorithms in question. IIRC

Re: Clojure/JVM languages internal presentation

2011-01-19 Thread Robert Campbell
Hi Shantanu, Good questions. > Can you share some details about the language selection process? Was it based > on developers consensus or it was a purely management decision? Was the > presence or absence of enough number of Clojure/Scala experts in the team > influential on the eventual decis

Re: Getting started with Counterclockwise

2011-01-19 Thread Laurent PETIT
2011/1/18 Ken Wesson > On Tue, Jan 18, 2011 at 1:14 PM, Chas Emerick > wrote: > > Any tone you might have picked up from Laurent might be a reaction to > your ranting about how ccw is apparently rubbish rather than asking for > help. > > Well, excse me for assuming, Another day, less tired

Re: Getting started with Counterclockwise

2011-01-19 Thread Laurent PETIT
2011/1/19 Meikel Brandmeyer > Hi, > > On 19 Jan., 00:28, Luc Prefontaine > wrote: > > > Can you provide the plugin list from Eclipse ? (About -> Installation > > details) > > A while back I ran into a similar problem: a fresh install of eclipse > + only ccw didn't work on my machine. Mysteriousl

Re: ANN: Textmash - another IDE for Clojure

2011-01-19 Thread Laurent PETIT
Hello, 2011/1/18 Olek > Hi, > > Here is a link: http://code.google.com/p/textmash/ > > Some time ago I have written it in order to help accomplish a task of > creating some paraller processing system written entirely in Clojure > (it was the map reduce framework from Google). > > It was also us

Re: best way to define alias for all publics in ns?

2011-01-19 Thread Laurent PETIT
2011/1/18 Ken Wesson > On Tue, Jan 18, 2011 at 1:07 PM, Stuart Sierra > wrote: > > You're not really aliasing the Vars, you're creating new Vars and copying > > the root values from the originals. > > This leads to subtle bugs when the original Vars are dynamically rebound > or > > redefined. T