Re: Autodoc dependencies broken?

2010-11-28 Thread Brendan Ribera
I'm seeing related weirdness on a project that has no dependencies except Clojure itself. It'll accept any Clojure from 1.0.0 up, but will default to downloading the newest version: :dependencies [[org.clojure/clojure [1.0.0,)]] The error I get is the same (missing

Re: Leiningen 1.3 question

2010-10-21 Thread Brendan Ribera
'lein deps' deletes the lib directiory whenever it runs, and this is the expected behavior. 'lein jar' runs deps first, so that's why lib is disappearing. This shouldn't be a problem if all of your dependencies are specified in project.clj; deps should just repopulate a fresh lib directory. If you

Re: Clojure noob: refactoring factorial code

2010-07-16 Thread Brendan Ribera
In conventional imperative/procedural languages, as you pointed out, the algorithm used to calculate the factorial would be dependent on available compute resources. In order to select the appropriate algorithm one might select an arbitrary value (let's say 1000) and decide to use one

Re: Nubie Question

2010-03-24 Thread Brendan Ribera
Also, you need to use swap! on an atom, so you'll need to make savedColors one. Read here: http://clojure.org/atoms On Wed, Mar 24, 2010 at 2:51 PM, David Nolen dnolen.li...@gmail.com wrote: On Wed, Mar 24, 2010 at 5:43 PM, WoodHacker ramsa...@comcast.net wrote: Actually, swap! doesn't seem

Re: Why clojure does not have remove-duplicates and delete-duplicates ?

2010-03-12 Thread Brendan Ribera
There's also distinct: http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/distinct On Fri, Mar 12, 2010 at 10:24 AM, Mark Engelberg mark.engelb...@gmail.comwrote: Why not just use the set function? On Fri, Mar 12, 2010 at 10:20 AM, Giacecco giace...@giacec.co.uk wrote:

Re: binary representation + operators

2010-03-12 Thread Brendan Ribera
Whenever you use the 2r0 format, the reader automatically converts it to its base-10 Integer value. This transformation happens at the reader level right now -- check out the 'matchNumber' method in LispReader.java for details. So (as far as I can tell) this means that there is no standalone

Re: binary representation + operators

2010-03-12 Thread Brendan Ribera
are confusing representation of the thing with the thing. Integers don't have bases, bases are used when displaying them. The reader does not convert a 2r0 to a base-10 Integer value because there is no such thing. On Fri, Mar 12, 2010 at 4:23 PM, Brendan Ribera brendan.rib...@gmail.com wrote

Re: call java main from clojure

2010-03-09 Thread Brendan Ribera
You need to turn that argument into a genuine Java array like so: (Foo/main (into-array [yay])) On Tue, Mar 9, 2010 at 1:15 PM, TimDaly d...@axiom-developer.org wrote: I searched the archives and google but cannot find an example. How do I call main? packge thefoo; public class Foo {

Re: Concurrent requests for Java's HTTP Server

2010-03-08 Thread Brendan Ribera
This seems to be more of a Java question than a Clojure one, but I'll take a stab at it anyway. I'm assuming you refer to com.sun.net.httpserver.HttpServer. Per the docs, Management of threads can be done external to this object by providing a

Re: Programming Clojure, index-filter when

2010-03-08 Thread Brendan Ribera
Should you pass in nil, the 'when' will guard against a NPE. On Mon, Mar 8, 2010 at 2:32 PM, Martin Hauner martin.hau...@gmx.net wrote: Hi, there is an example in programming clojure (Chapter 2.6, Where is my for loop? on page 52) that I don't really get. (defn index-filter [pred coll]

Re: Data manipulation question

2010-03-05 Thread Brendan Ribera
Or if you want something that is agnostic about the structure of your input map, try this: (defn alter-map [in-map] (map (partial reduce merge) (partition (count (keys in-map)) (apply interleave (map (fn [p] (map #(hash-map (first p)

Re: deftype comment

2010-02-13 Thread Brendan Ribera
You should be able to do (assoc p :x 3), you should get back #:Posn{:x 1, :y 2} You meant that you get back #:Posn{:x 3, :y 2}, right? Sounds reasonable to me. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: clj-peg v0.6 released

2010-01-28 Thread Brendan Ribera
I can't speak for Michal, but here's my take: Developers working on and with open source languages typically like to use licenses compatible with the main language. When I say open source, I mean in the sense conveyed by the OSI (found here: http://www.opensource.org/docs/definition.php). When I

Re: Generalizing - -

2009-12-04 Thread Brendan Ribera
I'm not in Germany. I presume the concern isn't about you, but rather about the Germans who can't consider the code as free to use. I imagine the idea is to make the source truly open, everywhere. The problem is that it is an unreasonably high barrier to entry. There MUST be an