Re: The Path to 1.0

2009-04-18 Thread Konrad Hinsen
On 18.04.2009, at 01:13, Dan wrote: > do you prefer to have some clojure users united against subversion, > or divided by Rich not having chosen their preferred DVCS > (Mercurial users vs Git users, not sure whether clojure needs those > kinds of nonsense internal wars in the community

Re: Executable Namespace Proposal

2009-04-18 Thread Meikel Brandmeyer
Hi, Am 18.04.2009 um 01:16 schrieb Stephen C. Gilardi: I have a proposal for a standard way to make a namespace "executable" and to invoke it as a program/script. I miss this so badly! Up to now, I always used gen-class to compile a class with a main function to get this functionality. Since

Re: Problem using clojure.contrib.seq-utils

2009-04-18 Thread synphonix
Hello, I have problems using seq-utils with the latest versions of clojure and clojure-contrib. I use clojure rev 1352 and clojure-contrib rev 675. Using these two the first invocation of (use 'clojure.contrib.seq-utils) gives java.lang.NoSuchMethodError: clojure.lang.MultiFn.(Lclojure/lang/ IFn

Re: The Path to 1.0

2009-04-18 Thread Konrad Hinsen
On 18.04.2009, at 12:15, John Newman wrote: > 2) One way to maintain Clojure's flexibility would be if it were > like what the kernel is to a Linux distribution. What if every > distribution had to use the same standard set of packages? The > Linux ecosystem is much richer today because t

Re: concurrency skeletons

2009-04-18 Thread Konrad Hinsen
On 18.04.2009, at 01:59, Raoul Duke wrote: > anybody have experience with / opinions / thoughts / feelings on > skeletons (design patterns) for concurrency? > > e.g. http://camlp3l.inria.fr/eng.htm > > might the approach be useful even with STM? Yes. Skeletons are in principle no more than contr

Re: The Path to 1.0

2009-04-18 Thread Timothy Pratley
I'm eager to see Clojure turn 1.0 because it is a fantastic language that deserves to be even more popular than it already is. I believe it is time to put the message out there that clj has made the journey from "something to toy with" to "a serious language" or even "the next big thing". Clojure

Re: The Path to 1.0

2009-04-18 Thread John Newman
Well, perhaps if str-utils becomes the universal standard for string operations, it would be rolled into Clojure come 2.0? On Sat, Apr 18, 2009 at 2:58 PM, Konrad Hinsen wrote: > > On 18.04.2009, at 12:15, John Newman wrote: > > > 2) One way to maintain Clojure's flexibility would be if it were >

Re: Problem using clojure.contrib.seq-utils

2009-04-18 Thread Meikel Brandmeyer
Hi, Am 18.04.2009 um 12:17 schrieb synphonix: java.lang.NoSuchMethodError: clojure.lang.MultiFn.(Lclojure/ lang/ IFn;Ljava/lang/Object;Lclojure/lang/IRef;)V(NO_SOURCE_FILE:0) later invocations result in java.lang.NoClassDefFoundError: Could not initialize class clojure.contrib.seq_utils__init

Re: The Path to 1.0

2009-04-18 Thread John Newman
> I do not agree with John Newman that the Java standard library > should be the Clojure standard library. > I'm not saying that. I'm saying that: 1) Requiring Java's standard library on every system is unfortunate enough -- it's too big for some of the smaller devices coming out now. And, 2) O

Re: Problem using clojure.contrib.seq-utils

2009-04-18 Thread synphonix
Hi Meikel, I did that already and it did not help. I also explictly unset my CLASSPATH env in the shell from which I start ant (just to be sure) and checked that the "clojure.jar" property in clojure-contrib's build.xml is correct. I do not see this behavior when I switch clojure to svn rev 1339.

#(%) error in map

2009-04-18 Thread Michael Hunger
I tried to use an anonymous function in map but it didn't work. user=> (map #(%) '(1 2 3)) java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn but with a normal anonymous function it works as expected: user=> (map (fn [x] x) '(1 2 3)) (1 2 3) Thanks Michael P.S

Re: #(%) error in map

2009-04-18 Thread Laurent PETIT
Hello, what you want here is identity : (map identity (list 1 2 3)) Regards, -- Laurent 2009/4/18 Michael Hunger > > I tried to use an anonymous function in map but it didn't work. > > user=> (map #(%) '(1 2 3)) > java.lang.ClassCastException: java.lang.Integer cannot be cast to > clojure.la

Re: #(%) error in map

2009-04-18 Thread Michael Hunger
I think my misconception was not the missing identiy fun but rather that the first element in the list is the function that is evaluated. so #(%) is trying to evaluate whatever % evaluates to, e.g. (1) and therefore there is the java.lang.ClassCastException: java.lang.Integer cannot be cast to

Re: The Path to 1.0

2009-04-18 Thread Isak Hansen
On Thu, Apr 16, 2009 at 6:53 PM, Rich Hickey wrote: > > Feedback welcome, > 1. I'd like to see a road map of sorts; plans for where Clojure will be going with the next couple of releases. 2. Clojure-contrib -cleanup - Move the clojure test suite to clojure itself - Move 'worthy' libraries fro

Re: Executable Namespace Proposal

2009-04-18 Thread Stephen C. Gilardi
On Apr 18, 2009, at 5:24 AM, Meikel Brandmeyer wrote: Ok. You asked for it, so I will play the devil's advocate! Why this fixing on one somehow blessed function? When the namespace is loaded I can call any public function directly. Why do I need (run ...)? I don't see the value of this, since

Re: #(%) error in map

2009-04-18 Thread Laurent PETIT
2009/4/18 Michael Hunger > > I tried to use an anonymous function in map but it didn't work. > > user=> (map #(%) '(1 2 3)) > java.lang.ClassCastException: java.lang.Integer cannot be cast to > clojure.lang.IFn > > but with a normal anonymous function it works as expected: > > user=> (map (fn [x]

Re: Problem using clojure.contrib.seq-utils

2009-04-18 Thread Meikel Brandmeyer
Hi, Am 18.04.2009 um 13:29 schrieb synphonix: I did that already and it did not help. I also explictly unset my CLASSPATH env in the shell from which I start ant (just to be sure) and checked that the "clojure.jar" property in clojure-contrib's build.xml is correct. I do not see this behavior w

Re: #(%) error in map

2009-04-18 Thread Meikel Brandmeyer
Hi, Am 18.04.2009 um 14:32 schrieb Michael Hunger: that also happens with #((+ % 1)) #(%) is equivalent to (fn [x] (x)). So giving an integer as argument will basically to call an integer => *BOOM*. As you correctly noted. #((+ % 1)) will be transformed to (fn [x] ((+ x 1))) and again you wi

Re: Executable Namespace Proposal

2009-04-18 Thread Meikel Brandmeyer
Hi, Am 18.04.2009 um 14:34 schrieb Stephen C. Gilardi: java -cp .. clojure.main -E my.ns/main my-script-defining-my-ns.clj I'm trying to make this kind of command line easier to use and explain. We basically already have what you're proposing: java -cp .. clojure.main -i my-script-definin

Help writing a lazy version of this Choose function.

2009-04-18 Thread CuppoJava
Hi, I just wrote a very small combinatorics utility for myself. Choose. It is given a vector of elements, followed by a number that indicates how many elements to "choose" out of the vector. It returns all possible combinations of choosing elements out of while retaining the correct order. I hi

Re: Improving clojure.jar/clojure-contrib.jar compression (ClassLoader alternatives)

2009-04-18 Thread kevin
You can use java's pack200 tool to compress your jar down quite a bit: http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/pack200.html I haven't tried it yet, but this ClassLoader that will decompress the pack200 archive into a temp directory before loading the classes. http://scala.sygneca.com

Re: Standard startup script?

2009-04-18 Thread e
i wonder if others would think it'd be interesting to integrate clojure with http://jamvm.sourceforge.net/ ... maybe fork the project so that running a clj file feels exactly like running a py file ... embed the jvm in an exe. Maybe others like the fact that it works on top of any jvm, but I thin

Re: Problem using clojure.contrib.seq-utils

2009-04-18 Thread Michael Wood
I was having trouble building clojure-contrib after having updated both clojure and clojure-contrib. Clojure was already at HEAD. I have a habit of running "ant clean" before compiling. When I tried to build clojure-contrib, I was getting a stack trace, which was complaining about "get-method".

Re: #(%) error in map

2009-04-18 Thread Michael Wood
On Sat, Apr 18, 2009 at 2:52 AM, Michael Hunger wrote: > > I tried to use an anonymous function in map but it didn't work. > > user=> (map #(%) '(1 2 3)) > java.lang.ClassCastException: java.lang.Integer cannot be cast to > clojure.lang.IFn > > but with a normal anonymous function it works as ex

Updated clojure-pom (now even simpler to use with emacs)

2009-04-18 Thread dysinger
http://github.com/dysinger/clojure-pom/tree/master I found a way to unpack dependencies and added a function (see README) for emacs that sets up the classpath for a maven/clojure project. This way you can add dependencies with maven and not have to restart your slime session.. Since maven & slim

Re: Updated clojure-pom (now even simpler to use with emacs)

2009-04-18 Thread dysinger
Sorry that is clj-mvn-proj not clj-mvn-project On Apr 18, 9:12 am, dysinger wrote: > http://github.com/dysinger/clojure-pom/tree/master > > I found a way to unpack dependencies and added a function (see README) > for emacs that sets up the classpath for a maven/clojure project. > This way you ca

On Stuart's Book

2009-04-18 Thread George Jahad
Hey StuartH: I finally got around to buying your book yesterday. The thing that finally sold me was Rich's email about how important your book was. Without that, I wouldn't have considered paying for it, with so much other clojure material available on the web. I think it would be a good idea f

Re: On Stuart's Book

2009-04-18 Thread Rayne
So you want him to write something that Rich hasn't said on his website to market his book? :\ If not you're going to clarify a bit. I wish Stuart would have open sourced the book, like Real World Haskell did. Would have done all kinds of good for the language. But each to his own and Stuart rock

Re: The Path to 1.0

2009-04-18 Thread Antony Blakey
On 18/04/2009, at 5:38 PM, Konrad Hinsen wrote: > > On 18.04.2009, at 01:13, Dan wrote: > >> do you prefer to have some clojure users united against subversion, >> or divided by Rich not having chosen their preferred DVCS >> (Mercurial users vs Git users, not sure whether clojure needs those >>

Re: On Stuart's Book

2009-04-18 Thread Antony Blakey
On 19/04/2009, at 8:08 AM, Rayne wrote: > > So you want him to write something that Rich hasn't said on his > website to market his book? :\ But Rich has written that - it's from Rich's forward to Stuart's book. Am I misunderstanding your point? Antony Blakey - CTO, Linkuistics P

Re: Help writing a lazy version of this Choose function.

2009-04-18 Thread Laurent PETIT
Hello, It seems that the recursive call to choose is too eager. I had a problem with your version (which seems to be using a pre lazy-seq version) where nthrest still existed (?). But I rewrote something along the lines of what you did, and had first the same problem. Wrapping the recursive call

Re: On Stuart's Book

2009-04-18 Thread Michael Wood
On Sun, Apr 19, 2009 at 1:30 AM, Antony Blakey wrote: > > On 19/04/2009, at 8:08 AM, Rayne wrote: > >> >> So you want him to write something that Rich hasn't said on his >> website to market his book? :\ > > But Rich has written that - it's from Rich's forward to Stuart's book. > Am I misundersta

Re: Help writing a lazy version of this Choose function.

2009-04-18 Thread CuppoJava
Wow, that works great. Thanks a lot for your help Laurent. Can you think of any reason why mapcat isn't lazy by default though? I'm wondering if this is by design, or simply because we haven't had the time to update all the library functions to be fully lazy yet. -Patrick --~--~-~--~--

Monad mod

2009-04-18 Thread jim
Konrad, Love your monad library, but somethings always bothered me. The monad functions like m-seq, m-lift, etc. were macros so they couldn't be applied, passed as parameters. I'm impressed you were able to implement them using macros. While working on an unrelated thing, I had a flash of inspir

Help Improving Game Of Life in clojure

2009-04-18 Thread Michael Hunger
As I'm currently trying to learn clojure I wrote a game of life to get a feeling for the concepts. It would be great if some of you could point out areas for improvement or unused idioms or patterns. Thanks alot Michael here is the code: (ns gol) (comment "a board only contains the coordinate

IFn?

2009-04-18 Thread tmountain
Sorry for the newbie question, but can someone tell me what IFn means exactly? I keep running into it in the docs particularly in the keyword documentation, and Google has yet to expain. Thanks, Travis --~--~-~--~~~---~--~~ You received this message because you are

Re: IFn?

2009-04-18 Thread Kevin Downey
ifn? returns true for things that implement clojure.lang.IFn, IFn is the interface for things that can be put in the operator position in a s-expr: functions vectors maps sets keywords symbols ...? fn? returns true for just functions On Sat, Apr 18, 2009 at 9:37 PM, tmountain wrote: > > Sorry f

Re: The Path to 1.0

2009-04-18 Thread Tom Faulhaber
On Apr 18, 3:15 am, John Newman wrote: > > I do not agree with John Newman that the Java standard library > > should be the Clojure standard library. > > I'm not saying that.  I'm saying that: > John, I misunderstood what you were trying to say. My apologies! There seems to be some agreement

Re: On Stuart's Book

2009-04-18 Thread George Jahad
On Apr 18, 3:38 pm, Rayne wrote: > So you want him to write something that Rich hasn't said on his > website to market his book? :\ If not you're going to clarify a bit. > Rayne, I think you are getting stuck on the very point I was. It feels very odd paying for Stuarts book, when Rich has do