Why won't leiningen install for me?

2011-01-22 Thread Larry Travis
I get the following when I try to install Leiningen: --- larrytravis$ lein-install.sh self-install Downloading Leiningen now... dyld: Library not loaded: /opt/local/lib/libintl.8.dylib Referenced from: /opt/local/bin/curl Reason: no suitable image found. Did find:

Suspected REPL bug; behavior in empty namespace differs from what's documented

2011-01-22 Thread Ken Wesson
While futzing about with namespaces I managed to get my REPL borked enough to require a complete restart; every single thing, even bare integers, punched into it threw exceptions. I did some digging and found that this behavior differs from fairly official documentation, as follows. Practical

Re: Why no def- ?

2011-01-22 Thread Benjamin Teuber
I think a def- definitely belongs in core for consistency reasons. So I'm writing a ticket and patch now. Cheers, Benjamin -- 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

Re: Why no def- ?

2011-01-22 Thread Stuart Halloway
Please don't. It has already been discussed and declined. The metadata is uglier because we want doing this to be slightly ugly.. Stu Stuart Halloway Clojure/core http://clojure.com I think a def- definitely belongs in core for consistency reasons. So I'm writing a ticket and patch now.

Re: Why won't leiningen install for me?

2011-01-22 Thread Mark Rathwell
Are you using a MacPorts version of wget or curl? If so, see: http://stackoverflow.com/questions/2065904/macports-on-snow-leopard-rsync-library-not-loaded-libintl (note the comment regarding upgrading from Leopard to Snow Leopard) Also, for consistency, you will probably want to name your lein

Re: Why no def- ?

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 10:27 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: Please don't. It has already been discussed and declined. The metadata is uglier because we want doing this to be slightly ugly.. We do? Who is we and why does this we want doing this to be slightly ugly? --

Re: Why won't leiningen install for me?

2011-01-22 Thread Mark Rathwell
Probably also should have mentioned, there is a leiningen specific group that is fairly active, probably a better place to post these types of questions: http://groups.google.com/group/leiningen On Sat, Jan 22, 2011 at 10:28 AM, Mark Rathwell mark.rathw...@gmail.comwrote: Are you using a

Re: Why no def- ?

2011-01-22 Thread Stuart Halloway
1. You could optionally put a docstring after the value of a normal def -- (def foo 17 seventeen). def has supported an optional doc string since 1.2. I have just updated the wiki and docstring to reflect this. (defn foo Docstring -- works currently [x y] (+ (* x x) y))

A tiny producer-consumer framework

2011-01-22 Thread Ken Wesson
(defmacro consumer [[item] body] `(agent (fn c# [~item] ~@body c#))) (defmacro defconsumer [name item body] `(def ~name (consumer ~item ~@body))) (defn feed [consumer values] (doseq [v values] (send-off consumer apply [v]))) Nine lines of code. user= (defconsumer

Re: Why no def- ?

2011-01-22 Thread Stuart Halloway
Please don't. It has already been discussed and declined. The metadata is uglier because we want doing this to be slightly ugly.. We do? Who is we and why does this we want doing this to be slightly ugly? The Clojure/core team is led by its technical advisors, Rich Hickey and myself. In

Re: Why no def- ?

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 10:39 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: 1. You could optionally put a docstring after the value of a normal   def -- (def foo 17 seventeen). def has supported an optional doc string since 1.2. I have just updated the wiki and docstring to reflect

Re: Why no def- ?

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 10:48 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: Please don't. It has already been discussed and declined. The metadata is uglier because we want doing this to be slightly ugly.. We do? Who is we and why does this we want doing this to be slightly ugly?

Re: Why no def- ?

2011-01-22 Thread Stuart Halloway
Please don't. It has already been discussed and declined. The metadata is uglier because we want doing this to be slightly ugly.. We do? Who is we and why does this we want doing this to be slightly ugly? The Clojure/core team is led by its technical advisors, Rich Hickey and myself.

Re: A tiny producer-consumer framework

2011-01-22 Thread Eric Schulte
Nice concise example, A while back I implemented something similar; a propagator system using agents fed with `send', coming in at a slightly more verbose ~35 lines of code. http://cs.unm.edu/~eschulte/research/propagator/ Cheers -- Eric Ken Wesson kwess...@gmail.com writes: (defmacro

A not-so-tiny, priority-respecting producer-consumer framework

2011-01-22 Thread Ken Wesson
(deftype PriorityQueue [queue] clojure.lang.IObj (withMeta [this meta] (PriorityQueue. (with-meta queue meta))) (meta [this] (meta queue)) clojure.lang.IPersistentStack (cons [this object] (let [[v pri] object] (PriorityQueue. (merge-with #(conj %1 (first

Re: Unification

2011-01-22 Thread David Nolen
On Fri, Jan 21, 2011 at 11:41 PM, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I've read a bit about clojure.core.unify ( http://blog.fogus.me/2010/12/14/unification-versus-pattern-matching-to-the-death/ ) I haven't gotten through PAIP yet, but I gather unification libraries

Re: A tiny producer-consumer framework

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 11:26 AM, Eric Schulte schulte.e...@gmail.com wrote: Nice concise example, Thanks. A while back I implemented something similar; a propagator system using agents fed with `send', coming in at a slightly more verbose ~35 lines of code.

Re: Why no def- ?

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 11:13 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: Please don't. It has already been discussed and declined. The metadata is uglier because we want doing this to be slightly ugly.. We do? Who is we and why does this we want doing this to be slightly ugly?

Re: Unification

2011-01-22 Thread Shantanu Kumar
On Jan 22, 10:02 pm, David Nolen dnolen.li...@gmail.com wrote: On Fri, Jan 21, 2011 at 11:41 PM, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I've read a bit about clojure.core.unify ( http://blog.fogus.me/2010/12/14/unification-versus-pattern-matching-t... ) I haven't

Re: Unification

2011-01-22 Thread nicolas.o...@gmail.com
Is this also useful for implementing something like Datalog? If yes, in what ways? Regards, Shantanu I don't know for Datalog but for Prolog. Imagine you have parent(a,b). parent(b,c). ancestor(X,Y) :- parent(X,Z) , ancestor(Z,Y). (1) ancestor(X,Y) :- parent(X,Y). (2) Now you have the

Efficient queue types for Clojure.

2011-01-22 Thread Ken Wesson
(deftype Queue [chunk1 chunk2 size metadata] clojure.lang.IObj (withMeta [this m] (Queue. chunk1 chunk2 size m)) (meta [this] metadata) clojure.lang.IPersistentStack (cons [this object] (Queue. chunk1 (conj chunk2 object) (inc size) metadata)) (count [this] size) (empty [this]

Re: Suspected REPL bug; behavior in empty namespace differs from what's documented

2011-01-22 Thread Stuart Sierra
I think it's a bug in Enclojure's REPL. The examples work for me in Clojure 1.2.0 and 1.3.0-master at the command line. -Stuart Sierra Clojure/core http://clojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: records, metas, and type checking

2011-01-22 Thread Stuart Sierra
At the moment, it's a feature. Class type hints are only suggestions. Primitive type hints are enforced. -Stuart Sierra Clojure/core http://clojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Suspected REPL bug; behavior in empty namespace differs from what's documented

2011-01-22 Thread Aaron Bedra
Agreed. I get the same behavior as Stuart. If you suspect a bug like this please verify it against the most basic form of the REPL by starting clojure directly and trying your solution. On 01/22/2011 01:32 PM, Stuart Sierra wrote: I think it's a bug in Enclojure's REPL. The examples work for

Re: Problem with lazy-seq and heap space overflow

2011-01-22 Thread Tom Hall
Hi Marek, I too am a mostly Python guy looking at clojure. I think you will like the for macro as it is a lot like list comprehensions. I did Euler45 in clojure too and https://github.com/thattommyhall/Project-Euler/blob/master/45.clj runs in 700ms I thought it was quite a nice soln: triangles,

Re: Unification

2011-01-22 Thread rb
On Jan 21, 11:41 pm, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I've read a bit about clojure.core.unify (http://blog.fogus.me/2010/12/14/unification-versus-pattern-matching-t... ) I haven't gotten through PAIP yet, but I gather unification libraries enable logic programming?

Re: Efficient queue types for Clojure.

2011-01-22 Thread Mark Engelberg
Clojure already has a built in queue. The empty queue is: clojure.lang.PersistentQueue/EMPTY and then you can use all the usual conj/into/pop/peek functions on it. For some reason, PersistentQueue is not documented, so new users have no reason to know about it until they happen to ask about it

Re: Unification

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 2:09 PM, rb raphi...@gmail.com wrote: I'm not sure dataflow variables are available in clojure though, but would be happy to stand corrected (I heard about the contrib dataflow module, but from what I read it's more like cells updating based on upstream cells it depends

Re: Unification

2011-01-22 Thread David Nolen
On Sat, Jan 22, 2011 at 2:09 PM, rb raphi...@gmail.com wrote: On Jan 21, 11:41 pm, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I've read a bit about clojure.core.unify ( http://blog.fogus.me/2010/12/14/unification-versus-pattern-matching-t... ) I haven't gotten through

Re: Efficient queue types for Clojure.

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 2:14 PM, Mark Engelberg mark.engelb...@gmail.com wrote: Clojure already has a built in queue.  The empty queue is: clojure.lang.PersistentQueue/EMPTY and then you can use all the usual conj/into/pop/peek functions on it. For some reason, PersistentQueue is not

Re: Why won't leiningen install for me?

2011-01-22 Thread Bizics
Hi Larry, I had problems installing too. Turns out curl on mac os x does not support https as required by github now. I had to download and rebuild curl with the +ssl flag for https to be supported and then things worked fine. I could dig up my notes from when I did it if you need more

Creating standalone executable

2011-01-22 Thread Miki
Greetings, What is the best option to create a stand alone executable from Clojure project (something like py2exe). (I want to bundle the JRE in the application). I did read http://stackoverflow.com/questions/2258932/embed-a-jre-in-a-windows-executable and some other links, but I want to hear

Re: Creating standalone executable

2011-01-22 Thread Aaron Bedra
You should take a look at http://data-sorcery.org/2010/06/12/incanter-executables/ which is a great place to start. On 01/22/2011 02:51 PM, Miki wrote: Greetings, What is the best option to create a stand alone executable from Clojure project (something like py2exe). (I want to bundle the

Re: Why won't leiningen install for me?

2011-01-22 Thread gaz jones
are you sure you dont have curl installed by macports or something? /usr/bin/curl on mac os x works fine with https for me... someone at work had this problem and they had (unknowingly) installed curl through macports... On Sat, Jan 22, 2011 at 1:28 PM, Bizics john.stuart.hun...@gmail.com wrote:

Re: Efficient queue types for Clojure.

2011-01-22 Thread Chouser
On Sat, Jan 22, 2011 at 2:14 PM, Mark Engelberg mark.engelb...@gmail.com wrote: Clojure already has a built in queue.  The empty queue is: clojure.lang.PersistentQueue/EMPTY and then you can use all the usual conj/into/pop/peek functions on it. For some reason, PersistentQueue is not

Re: Efficient queue types for Clojure.

2011-01-22 Thread Mark Engelberg
On Sat, Jan 22, 2011 at 2:29 PM, Chouser chou...@gmail.com wrote: Clojure's sorted collections are binary trees thus log2, not log32 like the hashed collections. Good point. My mistake. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Efficient queue types for Clojure.

2011-01-22 Thread Ken Wesson
On Sat, Jan 22, 2011 at 5:36 PM, Mark Engelberg mark.engelb...@gmail.com wrote: On Sat, Jan 22, 2011 at 2:29 PM, Chouser chou...@gmail.com wrote: Clojure's sorted collections are binary trees thus log2, not log32 like the hashed collections. Good point.  My mistake. That makes it up to a

Re: ANN: Textmash - another IDE for Clojure

2011-01-22 Thread Laurent PETIT
Hello again Olek, 2011/1/18 Olek aleksander.nas...@gmail.com 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

Getting clojure projects into maven central - aot vs sources, -javadoc and -sources artifacts

2011-01-22 Thread Peter Schuller
Hello, I'm experimenting with getting my feet wet with proper maven central releases by trying to get a small library[1] into maven central. The sonatype instructions[2] require, among other things: (1) If the project packaging is jar, and the jar file contains java classes, there must be a

JSpinner SpinnerModel for numbers with different step sizes - beating Java in its own domain

2011-01-22 Thread Eugen Dück
Anyone who has seen the subject implemented in Java/Swing might have been stunned by the hundreds of lines of code that were deemed necessary for it, with their appropriate share of bugs. (And an implementation I've seen in C#/NetAdvantage was even worse, which was less related to the language

Re: JSpinner SpinnerModel for numbers with different step sizes - beating Java in its own domain

2011-01-22 Thread Eugen Dück
To guard against NPEs, align-to-tick-size should be (defn align-to-tick-size [tick-map value] (if-let [tick-size (get-tick-size tick-map value false)] (let [remainder (mod value tick-size)] (if (zero? remainder) value (* tick-size ((if (= remainder (/ tick-size 2))

Re: Getting started with Counterclockwise

2011-01-22 Thread Sean Corfield
On Tue, Jan 18, 2011 at 12:45 PM, Chas Emerick cemer...@snowtide.com wrote: The links to the users' and developers' google groups for ccw are prominently linked on the right side of the ccw site: http://code.google.com/p/counterclockwise/ And that URL is the #1 Google result for: clojure

Re: Creating standalone executable

2011-01-22 Thread Carson
I've given launch4j http://launch4j.sourceforge.net/ a try and it seems to work well for building Windows exe. I use lein to build an uberjar and then use launch4j to make the exe. Please let me know if you find something better though. :) Best, Carson -- You received this message because