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

2009-09-25 Thread Rick Moynihan
2009/9/24 wmacgyver : > > 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 best book curren

Re: Namespace/class visibility in eval

2009-09-25 Thread Philipp Meier
On 23 Sep., 15:33, John Harrop wrote: > On Wed, Sep 23, 2009 at 8:50 AM, Philipp Meier 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 policy file will to the trick, I

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 wrote: > I'm still learning, myself, so I could be wrong, but you might be able to > use clojure.c

Adding Classpaths On The Fly

2009-09-25 Thread Volkan YAZICI
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 /tmp/code/examples/snake.clj file.) For this purpose, I tried below two steps with no luck. - (System/set

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 > > Hi, > > I'm trying to add a classpath to the current Clojure REPL session on the > fly. (Particularly, I extracted shcloj-co

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 wrote: > 2009/9/24 wmacgyver : > > > > > 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 Fr

Re: Is knowing Java a prerequisite for using Clojure?

2009-09-25 Thread Jeff Heon
On Sep 17, 10:01 pm, Hugh Aguilar 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. http://www2.computer.org/portal/

Re: Adding Classpaths On The Fly

2009-09-25 Thread David Nolen
On Fri, Sep 25, 2009 at 3:02 AM, Volkan YAZICI wrote: > > 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 /tmp/code/examples/snake.clj > file.) For

Re: Getting REPL transcript

2009-09-25 Thread Stuart Sierra
On Sep 23, 1:09 pm, John Harrop 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 src/clj/clojure/main.cl

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

2009-09-25 Thread Stuart Sierra
On Sep 23, 3:39 pm, MarkSwanson 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 me. -Stuart Sierra --~--

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 testing

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- wr

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. H

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread John Harrop
On Fri, Sep 25, 2009 at 4:49 PM, Constantine Vetoshev wrote: > (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 (y) (1+ y

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread Constantine Vetoshev
On Sep 25, 6:02 pm, John Harrop 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 subscribed to the Google Gr

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] (l

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread John Harrop
On Fri, Sep 25, 2009 at 8:48 PM, Constantine Vetoshev wrote: > > On Sep 25, 6:02 pm, John Harrop 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 weirdly inconsistent. It shou

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 m