Re: Patch Review

2009-10-20 Thread Timothy Pratley
On Oct 21, 4:27 pm, Phil Hagelberg wrote: > I wonder if we got more manpower involved in that process if it would > mean less work for Rich and the committer team when they are ready to > apply patches since it weeds out the patches that are clearly not > ready. Some projects I've worked on wil

Patch Review

2009-10-20 Thread Phil Hagelberg
So it's great to see new ideas popping up like protocols and datatypes, but I've noticed that the list of patches ready to apply to Clojure gets pretty long and doesn't seem to move that fast. I don't mean to complain; I'd much rather have Rich and co. working on exciting new features than spendi

Re: typed structs?

2009-10-20 Thread Richard Newman
> I'm trying to develop a library for structs (hopefully will be > generally useful), with an API parallel to the struct API. One of the > capabilities I would like to have is \typed \structs, i.e., if you > attempt to assoc something of the wrong type to a field, it throws an > error. Following

typed structs?

2009-10-20 Thread nchubrich
I'm trying to develop a library for structs (hopefully will be generally useful), with an API parallel to the struct API. One of the capabilities I would like to have is \typed \structs, i.e., if you attempt to assoc something of the wrong type to a field, it throws an error. (I can't find anyth

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Alex Osborne
Dmitry Kakurin wrote: >> Stylistic: you should not put the closing parens on dedicated lines. >> They are normally collected on the last line. While this is only a >> style issue, you should get used to it, since 99.9% of all code at in >> the wild will use that style... > > I've read it many tim

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread James Reeves
On Oct 21, 12:58 am, Phil Hagelberg wrote: > James Reeves writes: > > It also seems difficult to add your application to an online Maven > > repository. Do you know of any existing sites that make it easy to do > > this? > > It's pretty easy if you have sftp access: I'm kinda of the opinion tha

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread John Harrop
On Tue, Oct 20, 2009 at 7:40 PM, Dmitry Kakurin wrote: > P.S. Why does it take almost 2 DAYS for my messages to appear in this > group? I've sent two last messages on Sunday afternoon. It's to keep out spam. Posts from new users are held for manual approval, until they've made a few posts none o

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread Mark Derricutt
Have you checked out maven 3? http://www.wakaleo.com/blog/236-writing-your-pom-files-in-groovy-a-sneek-preview-of-maven-3s-polyglot-features This blog from John Smart shows using a groovy dsl for the pom. not sure how this is plugged into maven 3 itself, but I'm catching up with this weekend for

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread Phil Hagelberg
James Reeves writes: > It also seems difficult to add your application to an online Maven > repository. Do you know of any existing sites that make it easy to do > this? It's pretty easy if you have sftp access: http://stuartsierra.com/2009/09/08/run-your-own-maven-repository I think there's

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Dmitry Kakurin
On Oct 20, 5:52 am, Meikel Brandmeyer wrote: > > (defn multi-filter [filters coll] > >   (reduce > >     (fn [res e] > >       (map (fn [f r] (if (f e) (conj r e) r)) > >         filters > >         res)) > >     (repeat (count filters) []) > >     coll)) > > I think this basically equivalent to

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread James Reeves
On Oct 20, 11:01 pm, Phil Hagelberg wrote: > 1 and 2 are the same with Maven, so it's just: > > 1. Install >  and > 2. Run > > which I believe is as few steps as you can really make it. You can remove the install step. If you run a script and you don't have the necessary dependencies, it seems l

Re: prn/read and infinities

2009-10-20 Thread Timothy Pratley
On Oct 21, 6:12 am, Brian Hurt wrote: > Watching their video on how to submit a new ticket, there is supposed to be > a big button on the upper left hand side of the tickets page to add a new > ticket- a button that doesn't appear on that web page to me. > > Brian Hi Brian Did you make/login

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread Phil Hagelberg
James Reeves writes: > On Oct 20, 8:50 pm, Phil Hagelberg wrote: >> I don't think it belongs in the runtime code at all. Just put a >> project.clj file in the top-level of your project, run a shell command >> to import your dependencies into your project, and then use a default >> project class

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread James Reeves
On Oct 20, 8:50 pm, Phil Hagelberg wrote: > I don't think it belongs in the runtime code at all. Just put a > project.clj file in the top-level of your project, run a shell command > to import your dependencies into your project, and then use a default > project classpath that knows where the dep

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread Phil Hagelberg
James Reeves writes: > On Oct 10, 6:33 pm, Stuart Sierra wrote: >> You know my opinion, which is that we should use Maven to manage >> dependencies.  Maven 3, due soonish, will enable non-XML project/ >> dependency descriptions. > > But presumably even Maven 3 will need a nice Clojure wrapper.

function rebinding and logging

2009-10-20 Thread Jeff Sapp
Hey, I'm working on a small to medium sized, hopefully commercial product in clojure. I'll be providing an API to clients, and I'm also going to have to make some performance guarantees about a few of my functions. Because of that (as well as a few other reasons), I'm very interested interested in

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread James Reeves
On Oct 20, 4:21 pm, Drakeson wrote: > How about a system that deduces external dependencies out of (ns ...) > calls from a project, and possibly consults an extra file (e.g., > ./.dependencies) for the whole project that contains information like > below, in order to deduce the version required f

Re: data structures for efficient range queries

2009-10-20 Thread Sean Devlin
This is standard w/ Java 6. http://java.sun.com/javase/6/docs/api/java/util/NavigableMap.html On Oct 20, 11:16 am, Stuart Sierra wrote: > On Oct 20, 3:15 am, Volkan YAZICI wrote: > > > I think what you are after is an interval tree[1] data structure. You > > might find a suitable Java library

Re: prn/read and infinities

2009-10-20 Thread Brian Hurt
On Tue, Oct 20, 2009 at 11:57 AM, Rich Hickey wrote: > > Anyone can file a support ticket: > > http://www.assembla.com/spaces/clojure/support/tickets > > Rich > > I've been kicking around that website for an hour now, and can't find where to add a new ticket. So either a) I'm an idiot, or b) I d

Re: prn/read and infinities

2009-10-20 Thread Jeffrey Straszheim
I'm thinking this should be handled at the reader level, not the evaluator. Since doubles are normally "understood" at read time, reading these values as symbols and expecting the evaluator to get them right could lead to unexpected behavior. On Tue, Oct 20, 2009 at 11:57 AM, Rich Hickey wrote:

Re: Automatic parallelization (again)

2009-10-20 Thread Andreas Wenger
In the last paragraph, I mean: But perhaps it is at least possible to distinguish between "guaranteed side-effect FREE functions" (if we ignore the "binding" macro which can destroy this, as far as I understand) and "possible side-effect containing functions"? --~--~-~--~~

Automatic parallelization (again)

2009-10-20 Thread Andreas Wenger
In January, there was a discussion about automatic parallelization ( http://groups.google.com/group/clojure/browse_thread/thread/a053fac1235d3820/ - Google doesn't allow me to continue this thread, so I have to open a new one). I'm interested if anybody has made some progress in this topic? The

Re: prn/read and infinities

2009-10-20 Thread Rich Hickey
On Oct 20, 2009, at 11:15 AM, Brian Hurt wrote: > > > > I'll have to think about how best to handle this, but would appreciate > an issue in Assembla to track it. > > > > Sorry for the delay in responding. I don't seem to have permission > to add new tickets to the Clojure Assembla page. > A

Re: Opinions/Suggestions needed for dependency syntax

2009-10-20 Thread Drakeson
Hi James, James Reeves writes: > I'm working on a Clojure package manager called Capra, and I need some > opinions on the syntax for specifying dependencies. First of all, thanks for the effort you are putting into this missing and much desired part of Clojure ecosystem. I have a suggestion, a

Re: sequence manipulation question

2009-10-20 Thread Stuart Sierra
On Oct 20, 1:25 am, Alex Osborne wrote: > Because cons always creates a list (which construct at the front), while > conj "adds" it in the natural (ie fastest) way for that collection type, > vectors "add" at the end. In fact, all the generic sequence functions (cons, concat, map, distinct, filt

Re: data structures for efficient range queries

2009-10-20 Thread Stuart Sierra
On Oct 20, 3:15 am, Volkan YAZICI wrote: > I think what you are after is an interval tree[1] data structure. You > might find a suitable Java library or implement yours easily. > > Regards. > > [1]http://en.wikipedia.org/wiki/Interval_tree Yes, I think an interval tree is what you are looking fo

Re: prn/read and infinities

2009-10-20 Thread Brian Hurt
> > > I'll have to think about how best to handle this, but would appreciate > an issue in Assembla to track it. > > > Sorry for the delay in responding. I don't seem to have permission to add new tickets to the Clojure Assembla page. Brian --~--~-~--~~~---~--~~ Y

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Alex Osborne
Dmitry Kakurin wrote: > Thanks Alex, this is a VERY elegant solution. Hehe. I think I got a bit carried away generalising mine, but I found it interesting. :-) I think your way or Meikal's juxt (which is really neat, I didn't know about juxt) is much better for this specific problem. I gues

Re: Redirecting Output

2009-10-20 Thread Gorsal
Yep, dual core machine. --~--~-~--~~~---~--~~ 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

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Sean Devlin
Oops... I misread the problem statement. Sorry! On Oct 20, 9:36 am, Sean Devlin wrote: > Hey everyone, > I've developed a predicate library to handle stuff like this. > > http://github.com/francoisdevlin/devlinsf-clojure-utils/ > > Check out lib.devlinsf.pred-utils > > There are two methods, e

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Sean Devlin
Hey everyone, I've developed a predicate library to handle stuff like this. http://github.com/francoisdevlin/devlinsf-clojure-utils/ Check out lib.devlinsf.pred-utils There are two methods, ever-pred? and any-pred? designed to handle this. Here's an example ;;mimics OR user=> (filter (any-pre

Re: Redirecting Output

2009-10-20 Thread Jeffrey Straszheim
Speaking of which, NIO is certainly a subset of Java that would benefit from a nice Clojure wrapper. Not that I'm volunteering or anything. On Tue, Oct 20, 2009 at 3:06 AM, Alex Osborne wrote: > > John Harrop wrote: > > On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne > >

Re: Slime and stuff

2009-10-20 Thread Jeffrey Straszheim
Thanks! On Tue, Oct 20, 2009 at 4:01 AM, Giancarlo Angulo wrote: > > http://paulbarry.com/articles/2008/07/02/getting-started-with-clojure-and-aquamacs > > > > = > ANGOL > = > -|-^...@^_^, =|+^_^X++~_~,@- > > "The only thing worse than a hopeless romantic is a hopeful one" > >

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Meikel Brandmeyer
Hi, On Oct 20, 3:08 am, Dmitry Kakurin wrote: > (defn multi-filter [filters coll] >   (reduce >     (fn [res e] >       (map (fn [f r] (if (f e) (conj r e) r)) >         filters >         res)) >     (repeat (count filters) []) >     coll >   ) > ) I think this basically equivalent to the juxt

Re: data structures for efficient range queries

2009-10-20 Thread Timothy Pratley
On Oct 20, 2:19 pm, nchubrich wrote: > Thanks for the advice, everyone!  Timothy, I guess if you had non- > uniqueness but didn't care to have it indexed in more than one way you > could just take Alex's example and have his maps point to vectors, > right? Yup! --~--~-~--~~--

Re: Clojure Cheat Sheet

2009-10-20 Thread Rasmus Svensson
2009/10/19 Gorsal : > > All right, so this is probably way off topic, but what software was > used to create the clojure cheat sheet? > http://clojure.org/cheatsheet > I really like the format and would like to make one for my own > utilities so that I can actually remember what general utility >

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Dmitry Kakurin
Thank you for your feedback and interesting ideas. I've decided to bite the bullet and to write my own multi-filter fn. I'm very new to Clojure so any (constructive :-) ) criticism is welcome: (defn multi-filter [filters coll] (reduce (fn [res e] (map (fn [f r] (if (f e) (conj r e) r)

Re: data structures for efficient range queries

2009-10-20 Thread nchubrich
Thanks for the advice, everyone! Timothy, I guess if you had non- uniqueness but didn't care to have it indexed in more than one way you could just take Alex's example and have his maps point to vectors, right? --~--~-~--~~~---~--~~ You received this message bec

Re: data structures for efficient range queries

2009-10-20 Thread nchubrich
Sounds like the tree is what I need (since the data will be changing quite a bit). As for using a hash-map: wouldn't you need a sorted map to be able to pull out all the keys in a range? And then are the seq functions efficient for this? (I.E. if you drop a number of them to get to the beginnin

Re: b:vimclojure_namespace does not exist

2009-10-20 Thread Meikel Brandmeyer
Hi, On Oct 20, 5:42 am, eyeris wrote: > I've installed the latest VimClojure. I've added to my .vimrc: > > let g:clj_want_gorilla = 1 > let vimclojure#NailgunClient = ".../path/to/ng" > au BufRead,Bufnewfile *.clj setfiletype clojure This is not necessary. This is done by VC itself. > au BufR

Re: b:vimclojure_namespace does not exist

2009-10-20 Thread Meikel Brandmeyer
Hi, you are missing clojure classpath. Please make sure to include clojure and contrib in your classpath. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Best way to run multiple filters on the same [lazy] collection?

2009-10-20 Thread Dmitry Kakurin
Thanks Alex, this is a VERY elegant solution. But there is still ex-C++ programmer sitting inside my head, screaming "Ah, so many temporaries and lookups, this is so inefficient" :-). I'll try to make "him" shut up by comparing perf with my multi-filter approach. - Dmitry On Oct 18, 7:20 pm,

Re: Slime and stuff

2009-10-20 Thread Giancarlo Angulo
http://paulbarry.com/articles/2008/07/02/getting-started-with-clojure-and-aquamacs = ANGOL = -|-^...@^_^, =|+^_^X++~_~,@- "The only thing worse than a hopeless romantic is a hopeful one" Magbasa bago Mamuna. Mag-isip bago mambatikos Without Truth there is no Justice, Witho

Re: Clojure is two!

2009-10-20 Thread Timothy Pratley
Congratulations Rich and co! --~--~-~--~~~---~--~~ 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 pa

Re: data structures for efficient range queries

2009-10-20 Thread Volkan YAZICI
On Mon, 19 Oct 2009, nchubrich writes: > I need to make a data structure for a query such as "find everything > that is priced $3.27 - $6.12" (and perhaps sum up the total revenue > for all items in that price range). The naive way would be to make an > array with one slot for each increment in

Re: Redirecting Output

2009-10-20 Thread Alex Osborne
John Harrop wrote: > On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne > wrote: > > Gorsal wrote: > > However, this raises the CPU to about 50 percent. This is due to the > > infinite recursion, I'm assuming? > > Yes, it's because you're tight looping, chec

Re: Redirecting Output

2009-10-20 Thread John Harrop
On Tue, Oct 20, 2009 at 12:07 AM, Alex Osborne wrote: > Gorsal wrote: > > However, this raises the CPU to about 50 percent. This is due to the > > infinite recursion, I'm assuming? > > Yes, it's because you're tight looping, checking to see if data is > available as fast as possible. A quick and