Re: Why I have chosen not to employ clojure

2010-03-23 Thread Konrad Hinsen
On 23 Mar 2010, at 02:31, Lee Spector wrote: Someone else mentioned that maybe part of the problem is that there are several different simple ways to get started, and this may have been part of my own problem. What we have currently is lots of individuals who have figured out a good

Re: web starting clojure apps without Java code

2010-03-23 Thread Zmitro Lapcjonak
On Mar 17, 4:56 pm, Eugen Dück eu...@dueck.org wrote: The complete jnlp can be found athttp://dueck.org/kanshiki-boom/. I plan to introduce and document this beta-grade app soon, but if there's any Japanese learner out there interested in or in need of Kanji handwriting recognition, check

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Michael Kohl
On Tue, Mar 23, 2010 at 12:03 AM, cageface milese...@gmail.com wrote: Perhaps it would be useful to at least included a ready-to-go clj shell/batch script in the default distribution? Thanks to some awesome work by contributors, I think the one in ClojureX became fairly good over time:

compound conditions (and/or)

2010-03-23 Thread Michael Teter
Hello, and thanks in advance for suffering a beginner question ;) Is it possible to do a compound condition, such as if this test AND that test? And while I do want to know if there's a Clojure way to do multiple tests in one condition, my reason in this case for needing it is to test a number

Re: compound conditions (and/or)

2010-03-23 Thread Meikel Brandmeyer
Hi, On Mar 23, 10:09 am, Michael Teter tot...@gmail.com wrote: Is it possible to do a compound condition, such as if this test AND that test? (if (and (this test) (that test)) ... ...) or is left as an exercise. ;) For example, if 0 = x = 10.  I realize there may be a proper Clojure

Re: compound conditions (and/or)

2010-03-23 Thread Michael Teter
Excellent, exactly the information I was seeking. Thanks much! On Mar 23, 4:18 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Mar 23, 10:09 am, Michael Teter tot...@gmail.com wrote: Is it possible to do a compound condition, such as if this test AND that test? (if (and (this test)

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Michael Richter
On 23 March 2010 00:13, Luc Préfontaine lprefonta...@softaddicts.ca wrote: I looked at these videos and they are a very good starting point. Then do we have a communication problem getting these things known ? Are these videos listed on the Getting started page ? Let's see if I can get this

RE: mvn clojujure:repl - no keyboard echo

2010-03-23 Thread Kevin
Subject: Re: mvn clojujure:repl - no keyboard echo If jline is a problem, does removing it from the pom's dependencies solve the problem? Umm. Looks like I guessed wrong about jline. Took out the refs to jline in the Incanter pom, and got same problem. So I backed up a step, copied

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Carson
Maybe it'd be helpful to draw up several of the most common use-cases and target those with instructions. There are programmers new to some combination of Lisp/Clojure/Java either wanting to just get a taste of Clojure, or wanting to get a IDE/text editor (of their choosing) going to program in

Re: Why I have chosen not to employ clojure

2010-03-23 Thread rdunklau
I think that he made a good point, despite his rantings. As an experienced java developer, these are the steps I took while setting my environment up and running. - downloaded the jar, launched java -jar clojure.jar. I was able to fiddle with the repl, but when it came to code something dependent

Help optimizing array-to-integer operation?

2010-03-23 Thread Raph
I need a little help. I need to convert a 4-byte array to an integer as quickly as possible. (I use this operation in a tool I am writing, and I need to process millions of records per second, so performance matters.) In a half-Clojure, half-Java operation, I see: (time (dotimes [x 2400]

Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Thomas Kjeldahl Nilsson
Hello, my name's Thomas and I'm a Clojure newbie. :) My background consists of plenty of enterprise Java, a whole lot of JavaScript, some Ruby, plus some Scheme (The Little Schemer). I'm finally getting off my butt and looking at Clojure - looking forward to it. The community looks really nice

Counting vowels, take II.

2010-03-23 Thread Douglas Philips
Last week, Per Vognsen answered my first version of this question, how can I number just the vowels in a string: http://groups.google.com/group/clojure/msg/22186113b36041f1?hl=en But that got me thinking that numbering was just an instance of consuming from the (iterate inc 0) sequence. As I

Re: Help optimizing array-to-integer operation?

2010-03-23 Thread Konrad Hinsen
On 23.03.2010, at 08:55, Raph wrote: I have tried various hinting methods, but I cannot increase the speed. What can I do to make the clojure operations as fast as the native Java operations? Get rid of the reduce and unroll the bit-or computations instead: (defn arr-to-int [#^ints x]

Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-23 Thread Alex Osborne
Hi Eric, Eric Thorsen ethor...@enclojure.org writes: This is more of a maven question probably, but I have an app that needs versions of the jars built with jdk 1.5 and I'm using the http://build.clojure.org/snapshots repo where they appear to be built with 1.6. Are there versions (or plans

Re: Counting vowels, take II.

2010-03-23 Thread Meikel Brandmeyer
Hi, here some notes: On Mar 23, 12:53 pm, Douglas Philips d...@mac.com wrote:        (semi-map vowel? list \Hellow Word\ (iterate inc 1))     - (\\H (\\e 1) \\l \\l (\\o 2) \\w \\space \\W (\\o 3) \\r \\d) I would use vector instead of list in the example since vector is more idiomatic in

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Alex Osborne
Hi Thomas, Thomas Kjeldahl Nilsson tho...@kjeldahlnilsson.net writes: Question: I'm in the very first pages of the 'Programming Clojure' book. I understand that the language is still young and evolving, and thus a moving target. What's the best way of getting up to speed? Can I just go

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Meikel Brandmeyer
Hi, one difference which shows up everywhere, is the method and constructor notation. While in the book the old is used - (. obj (method args ...)) - one should stick to the new one - (.method obj args ...). Similar for Contructors. (note trailing dot) and Static/ methodCalls. Since I haven't

Re: Help optimizing array-to-integer operation?

2010-03-23 Thread Per Vognsen
In addition, right now his Clojure code isn't directly analogous to his Java code. If he used an array of bytes instead of integers, he wouldn't need the bit-masking. Getting this to work revealed a big surprise to me. Java has only signed integer types: byte, short, int and long. Clojure reads

Re: Help optimizing array-to-integer operation?

2010-03-23 Thread Per Vognsen
Sorry, I didn't put that right. 0xFF would only be -1 as a signed byte. What I'm saying is that the interaction between the type system of integers and the reader's hexadecimal notation is pretty surprising to me. In particular, (byte 0xFF) throws an error. -Per On Tue, Mar 23, 2010 at 7:35 PM,

Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-23 Thread Eric Thorsen
I was grabbing the snapshots of clojure and clojure-contrib and using them in a Netbeans plugin (which needs 1.5. Netbeans just crashes in an RT call). (System/getProperty java.vm.version) The above returns the running jvm version. I was looking at the jar manifest to see what it was built with

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Sean Devlin
On Mar 22, 9:40 pm, Michael Richter ttmrich...@gmail.com wrote: On 23 March 2010 00:13, Luc Préfontaine lprefonta...@softaddicts.ca wrote:  I looked at these videos and they are a very good starting point. Then do we have a communication problem getting these things known ? Are these

Re: Counting vowels, take II.

2010-03-23 Thread Per Vognsen
Remember the one-liner I gave you last time? (defn indexed-pred [pred coll] (map #(if (pred %1) [%2 %1] [%1]) coll (reductions + 0 (map #(if (pred %) 1 0) coll Here's how little it has to change: (defn funkymonkey [pred src coll] (map #(if (pred %1) [(first %2) %1] [%1]) coll

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Stuart Halloway
I am pretty sure the book uses the idiomatic Java interop forms except where specifically demonstrating the other forms exist. If that is not true it is an erratum, please let me know. Stu Hi, one difference which shows up everywhere, is the method and constructor notation. While in the

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Meikel Brandmeyer
Hi, On Mar 23, 2:18 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: I am pretty sure the book uses the idiomatic Java interop forms except   where specifically demonstrating the other forms exist. If that is not   true it is an erratum, please let me know. Uh. Sorry. I was told in the

Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-23 Thread Stuart Sierra
On Mar 23, 9:08 am, Eric Thorsen eric.thor...@gmail.com wrote: Having the target=1.5 property set for the clojure-contrib build might get me where I need to be.  I just have not had a chance to try it yet. The clojure-contrib build does not call javac, so it shouldn't matter. -SS -- You

Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-23 Thread Stuart Sierra
On Mar 23, 9:08 am, Eric Thorsen eric.thor...@gmail.com wrote: The above returns the running jvm version.  I was looking at the jar manifest to see what it was built with which is where I saw the 1.6 reference for clojure-contrib. Oh, it's the JAR manifest that's the problem? Maybe this will

Re: clojure.contrib.json.write.print-json type coverage

2010-03-23 Thread Stuart Sierra
Current version of clojure.contrib.json on the github master branch uses protocols, and should have better type coverage. -SS On Mar 22, 2:24 pm, Jieren Chen jieren.c...@gmail.com wrote: Hey everyone I've come across a few situations where the print-json multi-method does not cover certain

Nubie Question

2010-03-23 Thread WoodHacker
I understand how conj works.But how do you add a value to a persistent vector?You have to add the new item to the vector with (conj vector item), but how do you assign the return value to the persistent vector. So far I have it working with a def -- (def vector (conj vector item)) --

Re: Nubie Question

2010-03-23 Thread David Nolen
On Tue, Mar 23, 2010 at 9:35 AM, WoodHacker ramsa...@comcast.net wrote: I understand how conj works.But how do you add a value to a persistent vector?You have to add the new item to the vector with (conj vector item), but how do you assign the return value to the persistent vector.

Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-23 Thread Stuart Sierra
On Mar 23, 9:43 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: If the JAR manifest is the problem, the following pom.xml lines will change it: Yet another option is to supply a completely custom manifest file that omits the Build-Jdk line altogether. But I still think the correct

Re: Nubie Question

2010-03-23 Thread Per Vognsen
By definition, persistent data structures are never mutable. But there are various kinds of mutable references (vars, refs, atoms, agents) that can _refer_ to persistent (hence unchanging) data structures. While David has given you an answer to your immediate query, I would ask you to step back

ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Stuart Halloway
The labrepl project (http://github.com/relevance/labrepl) is a tutorial environment for learning Clojure. It is open source under the same license as Clojure. Whether you are learning Clojure on your own, or teaching or learning in a classroom environment, I want labrepl to be useful to

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Michael Kohl
First off, great work on labrepl! I told people about it last night at our functional programming user group and they seemed to like the concept a lot :-) On Tue, Mar 23, 2010 at 3:13 PM, Stuart Halloway stuart.hallo...@gmail.com wrote: (5) Out-of-box experience audit. Is the leiningen-based

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Rich Hickey
On Mar 23, 2010, at 10:13 AM, Stuart Halloway wrote: The labrepl project (http://github.com/relevance/labrepl) is a tutorial environment for learning Clojure. It is open source under the same license as Clojure. Whether you are learning Clojure on your own, or teaching or learning in a

Re: Help optimizing array-to-integer operation?

2010-03-23 Thread Mark J. Reed
On Tue, Mar 23, 2010 at 8:40 AM, Per Vognsen per.vogn...@gmail.com wrote: Sorry, I didn't put that right. 0xFF would only be -1 as a signed byte. What I'm saying is that the interaction between the type system of integers and the reader's hexadecimal notation is pretty surprising to me. In

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Stuart Halloway
GIt just needed a little push. It's there now. Thanks Rich! On Mar 23, 2010, at 10:13 AM, Stuart Halloway wrote: The labrepl project (http://github.com/relevance/labrepl) is a tutorial environment for learning Clojure. It is open source under the same license as Clojure. Whether you are

Accidentally Retaining Head?

2010-03-23 Thread aria42
Hi, I was experimenting with some code and I had an largish sequence I did a doseq over. The memory hit the ceiling, which you expect since even though the head isn't retained GC doesn't happen until you hit your memory limit (is there a way to change that). Once it hit the memory limit, 1.2

Re: Help optimizing array-to-integer operation?

2010-03-23 Thread Per Vognsen
Interesting. It's Clojure 1.2.0-master-SNAPSHOT as of last week: Clojure 1.2.0-master-SNAPSHOT user= 0xff 255 user= (byte 0xff) java.lang.IllegalArgumentException: Value out of range for byte: 255 (NO_SOURCE_FILE:0) So, this looks like a new issue. Rich? -Per On Tue, Mar 23, 2010 at 8:39 PM,

Re: Accidentally Retaining Head?

2010-03-23 Thread Per Vognsen
It doesn't seem very accidental: the namespace binding for 'trees' is retaining the head. You probably want to wrap it in a function: (defn trees [] ...) -Per On Tue, Mar 23, 2010 at 9:40 PM, aria42 ari...@gmail.com wrote: Hi,  I was experimenting with some code and I had an largish

Re: Accidentally Retaining Head?

2010-03-23 Thread aria42
Whoops duh. That was silly, far to early on the west coast. On Mar 23, 7:46 am, Per Vognsen per.vogn...@gmail.com wrote: It doesn't seem very accidental: the namespace binding for 'trees' is retaining the head. You probably want to wrap it in a function: (defn trees []   ...) -Per On

Re: Why I have chosen not to employ clojure

2010-03-23 Thread cageface
So perhaps it would be worthwhile to create, like jruby, a single zip/ tgz file containing clojure, clojure-contrib, and a reasonable bin/clj file that will find at least the core clojure jar files on its own? I don't see how you're going to actually deploy any clojure apps, or connect to a

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Brian Hurt
On Tue, Mar 23, 2010 at 11:07 AM, cageface milese...@gmail.com wrote: So perhaps it would be worthwhile to create, like jruby, a single zip/ tgz file containing clojure, clojure-contrib, and a reasonable bin/clj file that will find at least the core clojure jar files on its own? I don't see

Re: Accidentally Retaining Head?

2010-03-23 Thread Per Vognsen
By the way, you seem to misunderstand some of the workings of GC. In the kind of generational scheme used in virtually all modern algorithms, a collection of the nursery (where allocations are first hatched) will only be forced when the memory assigned to the nursery is exhausted--not the memory

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Per Vognsen
Stuart's book is by all accounts excellent, but I'm not sure we want to be in the situation that Ruby once was in, where buying a book (PragProg's Pickaxe book) was virtually a prerequisite for getting started. -Per On Tue, Mar 23, 2010 at 10:11 PM, Brian Hurt bhur...@gmail.com wrote: On Tue,

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Alex Ott
Hello Stuart Halloway at Tue, 23 Mar 2010 10:37:51 -0400 wrote: SH GIt just needed a little push. It's there now. Thanks Rich! It's better to add plugins plugin groupIdcom.theoryinpractise/groupId artifactIdclojure-maven-plugin/artifactId version1.3/version

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Per Vognsen
This is awesome, Stuart. With the live web server, a great addition would be if the embedded code snippets would be interactively runnable and tweakable right there in the web page. I'll see about hacking that in myself. -Per On Tue, Mar 23, 2010 at 9:13 PM, Stuart Halloway

Logic programming in Clojure

2010-03-23 Thread jim
I just posted a new tutorial about doing logic programming in Clojure. It makes use of the mini-Kanren port to Clojure I did last year. It's intended to reduce the learning curve when reading The Reasoned Schemer, which is an excellent book. http://intensivesystems.net/tutorials/logic_prog.html

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Stuart Halloway
You also get this with the labrepl (http://github.com/relevance/ labrepl) which is free. Plus I am attempting (with a little help from you all) to keep the labrepl working with various IDEs. Stu Stuart's book is by all accounts excellent, but I'm not sure we want to be in the situation that

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Stuart Halloway
I think it is important to be clear about the difference between: (A) exploring Clojure (non trivially, including interesting Java libraries) (B) deploying Clojure into production. I nominate the labrepl (http://github.com/relevance/labrepl) as a solution for (A). It already includes

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Meikel Brandmeyer
Hi, On Mar 23, 3:13 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: (1) NetBeans (2) CounterClockwise (3) IDEA (x) Emacs Are you also interested in Vim integration? Sincerely Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post

The % Schemer Series - are they worth the money?

2010-03-23 Thread Sean Devlin
Hey folks, I'm looking to add to my bookshelf. I was wondering what this groups experience with the Schemer series of books is? Sean -- 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: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Stuart Halloway
Absolutely! (Shameful admission: I have never touched Vim in my life.) I figured leaving it out entirely was the fastest way to entice a contributor. :-) Stu Hi, On Mar 23, 3:13 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: (1) NetBeans (2) CounterClockwise (3) IDEA (x) Emacs

Re: The % Schemer Series - are they worth the money?

2010-03-23 Thread Per Vognsen
The Little Schemer is very basic. The Reasoned Schemer is quite advanced and definitely a worthwhile read. If you're looking for excellent Lisp reading material, you can't go wrong with Steele and Sussman's The Art of the Interpreter and their Lambda: The Ultimate X series of papers. One of my

Re: The % Schemer Series - are they worth the money?

2010-03-23 Thread Harold Ancell
At 10:45 AM 3/23/2010, Per Vognsen wrote: The Little Schemer is very basic. The Reasoned Schemer is quite advanced and definitely a worthwhile read. If you're looking for excellent Lisp reading material, you can't go wrong with Steele and Sussman's The Art of the Interpreter and their Lambda: The

Re: The % Schemer Series - are they worth the money?

2010-03-23 Thread Konrad Hinsen
On 23.03.2010, at 16:45, Per Vognsen wrote: The Little Schemer is very basic. The Reasoned Schemer is quite advanced and definitely a worthwhile read. +1 for The Reasoned Schemer. I never read the other parts. Lambda: The Ultimate X series of papers. One of my favorite Lisp books is

Re: Logic programming in Clojure

2010-03-23 Thread Quzanti
Very interesting write up. What advantages would prolog have over such a language. Or if we are trying to move beyond language wars - what styles of logic programming would be more natural in either one or the other? I say that because my first thought is if you could build a logic language on

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Rick Moynihan
On 23 March 2010 14:13, Stuart Halloway stuart.hallo...@gmail.com wrote: The labrepl project (http://github.com/relevance/labrepl) is a tutorial environment for learning Clojure. It is open source under the same license as Clojure. Whether you are learning Clojure on your own, or teaching or

Re: The % Schemer Series - are they worth the money?

2010-03-23 Thread cody koeninger
On Mar 23, 10:37 am, Sean Devlin francoisdev...@gmail.com wrote: Hey folks, I'm looking to add to my bookshelf.  I was wondering what this groups experience with the Schemer series of books is? Sean Little, seasoned, + the little MLer are awesome, only thing that comes close in terms of

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Stuart Halloway
Sounds like it is time to improve the README. :-) Run the repl and browse to localhost:8080. Click on a lab to get started. That's it. Better than plain HTML: * Code less susceptible to copy paste errors: it is evaluated in Clojure before being rendered in the browser. (This doesn't matter

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Michael Kohl
On Tue, Mar 23, 2010 at 4:07 PM, cageface milese...@gmail.com wrote: So perhaps it would be worthwhile to create, like jruby, a single zip/ tgz file containing clojure, clojure-contrib, and a reasonable bin/clj file that will find at least the core clojure jar files on its own?

Re: Logic programming in Clojure

2010-03-23 Thread Konrad Hinsen
On 23.03.2010, at 18:26, Quzanti wrote: I say that because my first thought is if you could build a logic language on top of LISP then would prolog be needed as the other AI language? Why do we need the hundreds of programming languages we have? We don't. It's just that different people have

Re: Why I have chosen not to employ clojure

2010-03-23 Thread cageface
On Mar 23, 11:09 am, Michael Kohl citizen...@gmail.com wrote: http://github.com/citizen428/ClojureX/archives/1.1.0 Sorry, really not trying to pitch my project here, but the archive above basically contains what you are asking for. Cool. Maybe we could link this and/or Stuart's labrepl from

Re: The % Schemer Series - are they worth the money?

2010-03-23 Thread Robert Campbell
I love the Little/Seasoned Schemer books. They feel lightweight, both physically and in content, and I managed to work through them fairly quickly. It was surprisingly fun. SICP/HTDP/PAIP, on the other hand, have more of the textbook feel which has so far kept me from working through them. The

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Meikel Brandmeyer
Hi, On Tue, Mar 23, 2010 at 11:37:13AM -0400, Stuart Halloway wrote: Absolutely! (Shameful admission: I have never touched Vim in my life.) I figured leaving it out entirely was the fastest way to entice a contributor. :-) Hehe. And I should learn to stay quiet. :) Sincerely Meikel --

Re: Logic programming in Clojure

2010-03-23 Thread jim
I've got to say that I'm not a logic programming guru. Mostly I just see the promise there. The observation about graph search came from the book Simply Logical that I linked to at the end, I believe. I certainly didn't originate it. If you check out Oleg's page, you'll find a lot of papers about

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Lee Spector
I like where this is going but I would suggest that there's a significant audience (including me and most of my students) in what we might call category A.01: Want to explore and even do some real work, but not necessarily work involving deploying apps, connecting to databases, working with

Re: Logic programming in Clojure

2010-03-23 Thread Anniepoo
As well as optimizing compilers, there are many knowledge bases available for prolog. Most people with a practical application that needs an expert system are probably far more invested in that knowledge base (the prolog code is a 'knowledge base') than in anything else. -- You received this

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Sean Devlin
Lein is a command line tool that you can use independently of your environment. 99.9% sure you won't break anything by installing it. Is this right Phil? Sean On Mar 23, 2:53 pm, Lee Spector lspec...@hampshire.edu wrote: I like where this is going but I would suggest that there's a

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Stuart Halloway
Labrepl (via leiningen) puts jars in a local lib directory. They shouldn't collide with to break anything else. Stu Lein is a command line tool that you can use independently of your environment. 99.9% sure you won't break anything by installing it. Is this right Phil? Sean On Mar 23,

The end goal

2010-03-23 Thread Joel Martin
I'll know that this problem is solved when the Setup and Getting Started sections of the main Getting Started page resemble this: - For debian and Ubuntu users: apt-get install clojure For Fedora and CentOS users: yum install clojure For other distributions: wget XXX.tgz tar

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Michael Richter
On 23 March 2010 23:11, Brian Hurt bhur...@gmail.com wrote: On Tue, Mar 23, 2010 at 11:07 AM, cageface milese...@gmail.com wrote: So perhaps it would be worthwhile to create, like jruby, a single zip/ tgz file containing clojure, clojure-contrib, and a reasonable bin/clj file that will find

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Rich Hickey
On Mar 23, 10:13 am, Stuart Halloway stuart.hallo...@gmail.com wrote: The labrepl project (http://github.com/relevance/labrepl) is a   tutorial environment for learning Clojure. It is open source under the   same license as Clojure. Whether you are learning Clojure on your own,   or teaching

Re: Counting vowels, take II.

2010-03-23 Thread Douglas Philips
On 2010 Mar 23, at 9:14 AM, Per Vognsen wrote: Remember the one-liner I gave you last time? Yup. It was the 'hard coded + 0' parts that had been ruminating in the back of my mind as being something that could be abstracted out. :) Since the one you just posted didn't have all the features

Re: Confused about =, native java arrays and seqs...

2010-03-23 Thread Frank Siebenlist
Sorry, I copied the wrong snippet from my repl - the correct one is: ... user (= (.getBytes a)(.getBytes a)) false user (= (seq (.getBytes a)) (seq (.getBytes a))) true ... although the previous extra (bytes...) doesn't change the example, it may add to the confusion ;-) -FS/ On Mar 23,

Confused about =, native java arrays and seqs...

2010-03-23 Thread Frank Siebenlist
My REPL shows: ... user (= (bytes (.getBytes a))(bytes (.getBytes a))) false user (= (seq (bytes (.getBytes a))) (seq (bytes (.getBytes a true ... in other words, equality for java byte arrays is defined differently than their seq'ed version. It seems that the native arrays are compared on

Re: Counting vowels, take II.

2010-03-23 Thread Douglas Philips
On 2010 Mar 23, at 8:26 AM, Meikel Brandmeyer wrote: here some notes: Thanks! I would use vector instead of list in the example since vector is more idiomatic in Clojure. Ok. Just my old lisp roots showing. Still haven't gotten the fingers/ spine rewired to use [] around defn parameters.

Re: Why I have chosen not to employ clojure

2010-03-23 Thread Carson
I second Lee's thought -- my work as a grad student is AI research, not application development. I'm glad I discovered Incanter's package (three lines of instructions [1]) that allows me to run a Swank server that I can easily connect to from Emacs (and Slime from the Emacs end can be easily

Can't call public method of non-public class

2010-03-23 Thread Konstantin Barskiy
I'm trying to reproduce ProcessBuilder example from java documentation http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html This is that example: ProcessBuilder pb = new ProcessBuilder(myCommand, myArg1, myArg2); MapString, String env = pb.environment(); env.put(VAR1, myValue);

Re: The % Schemer Series - are they worth the money?

2010-03-23 Thread Marek Kubica
On Tue, 23 Mar 2010 08:37:06 -0700 (PDT) Sean Devlin francoisdev...@gmail.com wrote: I'm looking to add to my bookshelf. I was wondering what this groups experience with the Schemer series of books is? Yes, The Little Schemer is nice when you need to learn recursion. I currently read The

Would it be possible to make a dumped clojure, a la dumped emacs?

2010-03-23 Thread Alex Coventry
I am considering developing for Android using clojure, but I gather it's slow to start up. I'm wondering whether the startup delay would be substantially reduced in a dumped version of clojure. This would be an image which already contains initialized versions of most of the data structures

listing factors of a number

2010-03-23 Thread Glen Rubin
Does anyone know of any existing libraries for clojure that has code which is optimized to list all of the factors of any given integer? -- 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: Why I have chosen not to employ clojure

2010-03-23 Thread e
I'm starring that post. Still haven't gotten Aquamacs working with clojure. will try yet again tonight. On Tue, Mar 23, 2010 at 3:28 PM, Carson c.sci.b...@gmail.com wrote: I second Lee's thought -- my work as a grad student is AI research, not application development. I'm glad I discovered

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Robert Lally
On 23 March 2010 12:31, Meikel Brandmeyer m...@kotka.de wrote: Hi, one difference which shows up everywhere, is the method and constructor notation. While in the book the old is used - (. obj (method args ...)) - one should stick to the new one - (.method obj args ...). Similar for

Re: Would it be possible to make a dumped clojure, a la dumped emacs?

2010-03-23 Thread Michael Kohl
On Tue, Mar 23, 2010 at 8:57 PM, Alex Coventry coven...@gmail.com wrote: I am considering developing for Android using clojure, but I gather it's slow to start up. I thought there are some issues re the Dalvik VM and Clojure? Does anyone have experience with this? -- You received this message

Re: Counting vowels, take II.

2010-03-23 Thread Meikel Brandmeyer
Hi, On Tue, Mar 23, 2010 at 01:33:54PM -0400, Douglas Philips wrote: (let [[s1 s1tail] seq1 Don't use this destructuring in this case, because it forces again the realisation of the seq one step ahead. If I need s1 anyways, what is the one step ahead part that you refer to?

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread ataggart
On Mar 23, 1:04 pm, Robert Lally rob.la...@gmail.com wrote: On 23 March 2010 12:31, Meikel Brandmeyer m...@kotka.de wrote: Hi, one difference which shows up everywhere, is the method and constructor notation. While in the book the old is used - (. obj (method args ...)) - one should

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Rob Wolfe
Stuart Halloway stuart.hallo...@gmail.com writes: The labrepl project (http://github.com/relevance/labrepl) is a tutorial environment for learning Clojure. It is open source under the same license as Clojure. Whether you are learning Clojure on your own, or teaching or learning in a classroom

Re: listing factors of a number

2010-03-23 Thread kotor
On Mar 23, 1:02 pm, Glen Rubin rubing...@gmail.com wrote: Does anyone know of any existing libraries for clojure that has code which is optimized to list all of the factors of any given integer? (defn factors [x] integer - vector[integers] (loop [xf [] i 2] (if ( (* i i) x) (vec

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Robert Lally
On 23 March 2010 20:16, ataggart alex.tagg...@gmail.com wrote: On Mar 23, 1:04 pm, Robert Lally rob.la...@gmail.com wrote: On 23 March 2010 12:31, Meikel Brandmeyer m...@kotka.de wrote: Hi, one difference which shows up everywhere, is the method and constructor notation. While

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Mark Derricutt
1.3.2 is the latest version of the plugin and fixes some issues with the replScript settings ( it actually continues to run the repl, and not just exits - doh!) -- Pull me down under... On Wed, Mar 24, 2010 at 4:16 AM, Alex Ott alex...@gmail.com wrote: Hello Stuart Halloway at Tue, 23 Mar

Re: ANN: labrepl, making Clojure more accessible

2010-03-23 Thread Laurent PETIT
I'll do the counterclockwise review tonight, review soon to come 2010/3/23 Stuart Halloway stuart.hallo...@gmail.com: The labrepl project (http://github.com/relevance/labrepl) is a tutorial environment for learning Clojure. It is open source under the same license as Clojure. Whether you are

Re: Introduction + question re. diff between 'Programming Clojure'

2010-03-23 Thread Meikel Brandmeyer
Hi, On Tue, Mar 23, 2010 at 08:04:34PM +, Robert Lally wrote: I ask because I found that every time I wanted to change my code from (.method1 object) to (.. object method1 method2) it would have been easier if the code were (. object method1) moving to (.. object method1 method2) and,

Re: Can't call public method of non-public class

2010-03-23 Thread Stuart Campbell
Hi Konstantin, From JDK docs ( http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html#environment%28%29 ): The behavior of the returned map is system-dependent. A system may not allow modifications to environment variables or may forbid certain variable names or values. For this

Re: Can't call public method of non-public class

2010-03-23 Thread Armando Blancas
You want Clojure to treat 'env' as a Map instead of its implementation class, which is not public. Just add the type hint #^Map to 'env''s def: user= (def pb (new ProcessBuilder [myCommand myArg])) #'user/pb user= (def #^Map env (.environment pb)) #'user/env user= (.put env VAR1, myValue) myValue

Re: Can't call public method of non-public class

2010-03-23 Thread Stuart Campbell
Whoops... I completely glazed over the fact that the equivalent Java code worked perfectly :( On 24 March 2010 11:19, Armando Blancas armando_blan...@yahoo.com wrote: You want Clojure to treat 'env' as a Map instead of its implementation class, which is not public. Just add the type hint #^Map

destructuring / rest (was: Re: Counting vowels, take II.)

2010-03-23 Thread Douglas Philips
On 2010 Mar 23, at 4:13 PM, Meikel Brandmeyer wrote: (let [[s1 s1tail] seq1 In the above destructuring the first element of s1tail is also realised. That is what I mean with one step ahead. I'm not sure why it is done like this. I does not seem necessary. But I'm not an expert in

Re: Counting vowels, take II.

2010-03-23 Thread Per Vognsen
For laziness analysis, I typically use code like this: (defn trace-seq* [name xs] (for [x xs] (do (println (str name : x)) x))) (defmacro trace-seq [xs] `(trace-seq* ~(str xs) ~xs)) If I use it on the code I posted, I get this: user (take 3 (scan-filter-zip even? (trace-seq

Re: listing factors of a number

2010-03-23 Thread Per Vognsen
I'm sure that code would be useful if he were looking for a slow implementation of a slow algorithm. I believe he asked for an optimized algorithm. An example might be Lenstra's elliptic curve factorization or the general number field sieve. I don't know of any implementations in Clojure but there

Lazyness of range (was: Re: Counting vowels, take II.)

2010-03-23 Thread Douglas Philips
On 2010 Mar 23, at 9:28 PM, Per Vognsen wrote: So you can see that scan-filter-zip is lazy in the source sequence but apparently not the primary input sequence. That was surprising to me because I see nothing in my code that should have forced that. Then I remember that some functions like range

  1   2   >