Re: Monad problems: finding an m-zero

2009-11-21 Thread jim
Samppi, Here's a parser-m monad I did. (defmonad parser-m [m-result (fn [x] (fn [strn] (list x strn))) m-bind (fn [parser func] (fn [strn] (let [result (parser strn)]

Re: Clojure Scoping Rules

2009-11-21 Thread Armando Blancas
I sympathize with your difficulties, but isn't there something fundamentally incompatible between the later-or-never of lazy-seq and the this-way-here-and-now for which dynamic binding is good for? In this case you picked laziness over code simplification, maybe it'll be the other way around some

Re: Monad problems: finding an m-zero

2009-11-21 Thread samppi
Yes, your monad was the first monad that I was talking about—in fact, I followed your tutorial when I was learning about monads, and I used your examples to create an entire parsing library. I believe that it's essentially equivalent to (state-t maybe-m), except that you use list pairs instead of

Re: Clojure Scoping Rules

2009-11-21 Thread Mark Engelberg
On Sat, Nov 21, 2009 at 8:12 AM, Armando Blancas armando_blan...@yahoo.com wrote: I sympathize with your difficulties, but isn't there something fundamentally incompatible between the later-or-never of lazy-seq and the this-way-here-and-now for which dynamic binding is good for? In this case

Re: Clojure Scoping Rules

2009-11-21 Thread Graham Fawcett
On Sat, Nov 21, 2009 at 12:17 PM, Mark Engelberg mark.engelb...@gmail.com wrote: Intuitively, it seems to me that what one wants is for lazy data structures to contain bound values in some sort of closure-like thing so rebindings after the fact don't affect the data structure, but regular

Re: SLIME REPL broken

2009-11-21 Thread Robert Ewald
Hello, At Sun, 15 Nov 2009 06:21:03 -0800 (PST), Stefan Kamphausen wrote: Hi, a short discussion on the SLIME mailinglist lead to the result that the arglist of a backend function in swank did change. Current checkouts of SLIME do not work with Clojure, at least if you use autodoc.

Re: tree-shaking a jarred Clojure app?

2009-11-21 Thread David Brown
On Fri, Nov 20, 2009 at 06:37:18PM +, Jim Downing wrote: I might have misunderstood, but isn't the problem the same as in Java; you can't know from a static analysis which classes are going to be loaded? Except that Clojure will load all of them so it can bind them to the vars in each

One place where interop needs improvement

2009-11-21 Thread John Harrop
One place where interop needs improvement: imports. This is ridiculous: #CompilerException java.lang.ClassNotFoundException: java.awt (NO_SOURCE_FILE:0) sandbox= #CompilerException java.lang.ClassCastException: clojure.lang.LazilyPersistentVector cannot be cast to clojure.lang.Symbol

Re: tree-shaking a jarred Clojure app?

2009-11-21 Thread John Harrop
On Sat, Nov 21, 2009 at 8:30 PM, David Brown cloj...@davidb.org wrote: On Fri, Nov 20, 2009 at 06:37:18PM +, Jim Downing wrote: I might have misunderstood, but isn't the problem the same as in Java; you can't know from a static analysis which classes are going to be loaded? Except that

Re: Weird Java Interop Behaviour

2009-11-21 Thread David Brown
On Fri, Nov 20, 2009 at 03:54:45PM -0800, Mike Hinchey wrote: It's the . special form that makes the difference. In (. System (getProperty)), the dot interprets System as a class and looks for a static method (at read/compile time). With (identity System), System resolves to a value, a Class

Re: tree-shaking a jarred Clojure app?

2009-11-21 Thread David Brown
On Sat, Nov 21, 2009 at 08:42:26PM -0500, John Harrop wrote: Are you talking about binding things like String.class to vars referenced by symbols like String? Not just String.class, every single class referenced by a given namespace will be loaded, and most of them instantiated before a single

Re: One place where interop needs improvement

2009-11-21 Thread Alex Osborne
John Harrop wrote: 1: Improvements to the ns macro, such as described in a previous thread. Particularly I'd like to see (:import package class class class) work. This fits with normal Clojure syntax. Right now it wants an extra pair of parentheses, does not accept a vector(!), and

Re: Clojure Scoping Rules

2009-11-21 Thread nchubrich
Regarding Clojure sequence functions: why couldn't they have the option of returning non-lazy seqs? Because you don't always really need lazy seqs. It might be nice to have the option. (map (fn[x] x) [1 2 3] :strict) - [1 2 3] or even (binding [*strict* true] (map (fn[x] x) [1 2

Re: Clojure Scoping Rules

2009-11-21 Thread Richard Newman
It might be nice to have the option. You do -- wrap the form in doall. (binding [*strict* true] (map (fn[x] x) [1 2 3])) would be equivalent to (doall (map identity [1 2 3])) -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Clojure Scoping Rules

2009-11-21 Thread ataggart
Getting back to the initial post, this would be the (almost) equivalent code in java: public class Test{ static int x = 1; void bindingX(int val){ x = val; } int dummyFn2(){ return x + 1; } void dummyFn(){ System.out.println(entering function:

Re: Monad problems: finding an m-zero

2009-11-21 Thread jim
Glad you found that tutorial useful. I had to run this morning, so I couldn't really reply. I'll try to read your post more closely tomorrow and see if I can offer any useful insight. Jim -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Weird Java Interop Behaviour

2009-11-21 Thread John Harrop
On Sat, Nov 21, 2009 at 8:47 PM, David Brown cloj...@davidb.org wrote: On Fri, Nov 20, 2009 at 03:54:45PM -0800, Mike Hinchey wrote: It's the . special form that makes the difference. In (. System (getProperty)), the dot interprets System as a class and looks for a static method (at

Re: tree-shaking a jarred Clojure app?

2009-11-21 Thread John Harrop
On Sat, Nov 21, 2009 at 8:57 PM, David Brown cloj...@davidb.org wrote: On Sat, Nov 21, 2009 at 08:42:26PM -0500, John Harrop wrote: Are you talking about binding things like String.class to vars referenced by symbols like String? Not just String.class, every single class referenced by a

Re: tree-shaking a jarred Clojure app?

2009-11-21 Thread David Brown
On Sat, Nov 21, 2009 at 11:14:52PM -0500, John Harrop wrote: 1 second instead of 1/6 of a second. Yeah, like users will notice that difference in startup times. :) I'm not actually complaining, but I do notice every single time I fire up a REPL. The more code that you have, the longer it takes.

Re: One place where interop needs improvement

2009-11-21 Thread Alex Osborne
John Harrop wrote: On Sat, Nov 21, 2009 at 9:03 PM, Alex Osborne a...@meshy.org (:import package1 class class class) (:import package2 class class) I am. Especially since the latter already works. Alternatively, force (or at least allow!) square brackets, like elsewhere in Clojure

Re: ANN: Clojuratica v2 -- Seamless Mathematica-within-Clojure!

2009-11-21 Thread Rich Hickey
On Nov 20, 5:57 pm, Garth Sheldon-Coulson g...@mit.edu wrote: Dear Clojurians, I am very happy to announce Clojuratica version 2. Clojuratica now offers the **syntactic** integration of Clojure and Mathematica. What does this mean? It means you can write Clojure code that looks like

Re: tree-shaking a jarred Clojure app?

2009-11-21 Thread John Harrop
On Sat, Nov 21, 2009 at 11:21 PM, David Brown cloj...@davidb.org wrote: On Sat, Nov 21, 2009 at 11:14:52PM -0500, John Harrop wrote: 1 second instead of 1/6 of a second. Yeah, like users will notice that difference in startup times. :) I'm not actually complaining, but I do notice every

Re: One place where interop needs improvement

2009-11-21 Thread John Harrop
On Sat, Nov 21, 2009 at 11:43 PM, Alex Osborne a...@meshy.org wrote: John Harrop wrote: On Sat, Nov 21, 2009 at 9:03 PM, Alex Osborne a...@meshy.org (:import package1 class class class) (:import package2 class class) I am. Especially since the latter already works. Alternatively,

Re: Clojure Scoping Rules

2009-11-21 Thread cody koeninger
http://clojure.org/lisps All (global) Vars can be dynamically rebound without interfering with lexical local bindings. No special declarations are necessary to distinguish between dynamic and lexical bindings. Other part of that explanation is whether x in a given piece of code refers to a