Re: Bug in count for hash-maps with nil values

2009-09-25 Thread Christophe Grand
On Fri, Sep 25, 2009 at 1:46 AM, Richard Newman holyg...@gmail.com wrote: I guess this is already ticketed. I should have searched first, sorry for the noise. It's not already ticketed, even if the root cause might be the same. As I pointed out in my message, these are not hash maps,

Re: Can anyone here give a comparison between Clojure and Erlang on concurrent programming?

2009-09-25 Thread Rick Moynihan
2009/9/24 wmacgyver wmacgy...@gmail.com: Excellent summary of each language's sweet spot. I'd like to suggest a different book for Erlang though. For learning Erlang, I'd suggest Erlang Programming by Francesco Cesarini Simon Thompson, published by O'Reilly Yes, this is definitely the

Re: Namespace/class visibility in eval

2009-09-25 Thread Philipp Meier
On 23 Sep., 15:33, John Harrop jharrop...@gmail.com wrote: On Wed, Sep 23, 2009 at 8:50 AM, Philipp Meier phme...@gmail.com wrote: Remember that clojure runs in the JVM and a JVM can have a SecurityManager which can be configured to allow or deny at most any dangeroues operatíon. A java

Re: Getting REPL transcript

2009-09-25 Thread John Newman
I'm still learning, myself, so I could be wrong, but you might be able to use clojure.contrib.server-socket and tweak it's binding for *in*, *out*, and *err*, like another PushbackInputStream for *in* and copy the lines to a file before sending it into the repl. Or use a pipe perhaps? -- John

Re: Getting REPL transcript

2009-09-25 Thread Emeka
Thanks I will look into that. But more information on 'pipe' please? So we have two Newman{Rich, John}, so I will say thanks to Newmen. Regards, Emeka On Fri, Sep 25, 2009 at 10:43 AM, John Newman john...@gmail.com wrote: I'm still learning, myself, so I could be wrong, but you might be able

Re: Adding Classpaths On The Fly

2009-09-25 Thread Laurent PETIT
Hello, maybe this post from Christophe Grand can help : http://clj-me.blogspot.com/2009/01/living-on-bleeding-edge.html regards, -- laurent 2009/9/25 Volkan YAZICI volkan.yaz...@gmail.com Hi, I'm trying to add a classpath to the current Clojure REPL session on the fly. (Particularly, I

Re: Can anyone here give a comparison between Clojure and Erlang on concurrent programming?

2009-09-25 Thread mmwaikar
Thanks everyone for your enlightening responses. On Sep 25, 3:35 am, Rick Moynihan rick.moyni...@gmail.com wrote: 2009/9/24 wmacgyver wmacgy...@gmail.com: Excellent summary of each language's sweet spot. I'd like to suggest a different book for Erlang though. For learning Erlang, I'd

Re: Is knowing Java a prerequisite for using Clojure?

2009-09-25 Thread Jeff Heon
On Sep 17, 10:01 pm, Hugh Aguilar hugoagui...@rosycrew.com wrote: I want to create a DSL for generating gcode for cnc milling machines Unrelated to Clojure, but on the subject of DSL, the July/August 2009 issue (vol. 26 no. 4) of IEEE Software is dedicated to domain-specific modeling.

Re: Adding Classpaths On The Fly

2009-09-25 Thread David Nolen
On Fri, Sep 25, 2009 at 3:02 AM, Volkan YAZICI volkan.yaz...@gmail.comwrote: Hi, I'm trying to add a classpath to the current Clojure REPL session on the fly. (Particularly, I extracted shcloj-code.tgz of Programming Clojure to /tmp/code directory, and trying to load

Re: Getting REPL transcript

2009-09-25 Thread Stuart Sierra
On Sep 23, 1:09 pm, John Harrop jharrop...@gmail.com wrote: Actually, that suggests a more general point: that we can have programmatic access to the REPL's backlog if we modify the REPL process's Java code somewhat. The REPL is written in Clojure, so it's quite easy to modify. Look at

Re: test.clj / test/tap.clj error

2009-09-25 Thread Stuart Sierra
On Sep 23, 3:39 pm, MarkSwanson mark.swanson...@gmail.com wrote: I'm trying to use tst/tap.clj but the tap output does not contain the 'not ok' line. I think this is a bug in tap.clj. Here is the small test: You're right, it's a bug. Please file a ticket on Assembla; you can assign it to

Re: Schema for data structures

2009-09-25 Thread Miron Brezuleanu
Hi, thanks for the suggestions about writing an alternate defstruct. I tried to turn the wishful thinking from my initial email into code. Results here: http://github.com/mbrezu/beak-check Testing structures with beak-check requires some code, but it allows to test nested structures and

Macros, namespaces, and lexical scope

2009-09-25 Thread Constantine Vetoshev
(I asked these questions on #clojure, and the friendly locals suggested I open the question up for a wider audience.) I'm trying to write a macro-writing-macro. My code has a bunch of resources which have -open and -close type of calls, and they could all benefit from with- wrappers. The with-

Re: test.clj / test/tap.clj error

2009-09-25 Thread MarkSwanson
In case others wonder how do file a ticket on Assembla: 1. sign up for an Assembla account at www.assembla.com 2. Ack the signup email 3. go to : https://www.assembla.com/spaces/clojure-contrib/tickets 4. look for the 'create ticket' button. Then tell me where it is so I can also file a ticket.

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread John Harrop
On Fri, Sep 25, 2009 at 4:49 PM, Constantine Vetoshev gepar...@gmail.comwrote: (let [f1 #(inc %)] (defmacro m1 [x] `(~f1 ~x))) (m1 12) = No message. [Thrown class java.lang.ExceptionInInitializerError] The equivalent works in Common Lisp (Allegro CL and SBCL): (let ((f1 (lambda

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread Constantine Vetoshev
On Sep 25, 6:02 pm, John Harrop jharrop...@gmail.com wrote: I don't think you can use things like defmacro in a let. This works: (let [y 10] (defmacro m1 [] `(list ~y))) (m1) = (10) --~--~-~--~~~---~--~~ You received this message because you are

in-smaller-lists

2009-09-25 Thread Travis
I'm doing some file streaming with a lazy list and I ran into a problem where I had to process a whole chunk at a time, so I wrote this function. Just posting to see if I'm reinventing something or if it might be a good addition to contrib. (defn in-smaller-lists [the-list smaller-list-size]

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread John Harrop
On Fri, Sep 25, 2009 at 8:48 PM, Constantine Vetoshev gepar...@gmail.comwrote: On Sep 25, 6:02 pm, John Harrop jharrop...@gmail.com wrote: I don't think you can use things like defmacro in a let. This works: (let [y 10] (defmacro m1 [] `(list ~y))) (m1) = (10) Well, that's

Re: in-smaller-lists

2009-09-25 Thread Jeff Valk
On Friday 25 September 2009 at 08:46 pm, Travis wrote: I'm doing some file streaming with a lazy list and I ran into a problem where I had to process a whole chunk at a time, so I wrote this function. Just posting to see if I'm reinventing something or if it might be a good addition to

how to understand macro in clojure?

2009-09-25 Thread gerryx...@gmail.com
(defn float2 [f a b] (f (float a ) (float b))) (float2 + 1 2) = 3.0 (defmacro mfloat2 [f a b] (f (float a) (float b))) (mfloat2 + 1 2 ) = 2.0 ??? macro expend to last expression in list,right? (defmacro m2float2 [f a b] `(~f (float ~a) (float ~b))) (mfloat2 + 1 2) = 3.0 (defmacro