Re: Scala vs Clojure

2009-03-27 Thread Rayne
I sure hope this topic doesn't start a flamewar. I've used both languages, with Clojure being used more. Scala is more mature than Clojure, so you really have to put that in perspective when comparing the languages. Scala's IDE support is superior to Clojure's but not for long as all three major

Loading clojure in a custom ClassLoader

2009-03-27 Thread max3000
Hi, I want a Java application to support evaluation of older and newer clojure scripts that may not run on the same clojure versions/ releases. I want to support this without restarting the application. The approach I'm trying is to load clojure from its own classloader. My idea is to GC the cla

"(binding ...)" form and "pmap" (was: Are there ways to propagate bindings to child threads?)

2009-03-27 Thread hjlee
I wrote a question, but I think my point was not clear. I wanted some trace output of my codes, but my code uses heavily liked structure. After I found out there are vars that controls output, I tried that. Let's consider below codes. (I made runnable example.) (The main differenece from real co

Re: oo

2009-03-27 Thread mikel
On Mar 25, 3:44 am, Konrad Hinsen wrote: > I haven't thought much about extending types yet. It could mean   > opening the can of worms associated with inheritance and all that. I   > am waiting for a concrete situation where extension would be useful   > to think about how best to do it. The

Re: Characters allowed in symbols

2009-03-27 Thread Victor Rodriguez
On Fri, Mar 27, 2009 at 5:51 PM, ke...@ksvanhorn.com wrote: > > The Clojure documentation, under "Reader", gives a list of characters > allowed in a symbol name.  The characters, <, >, and = are not > included in this list.  How is it then that <, <=, >, >=, =, etc. are > symbols?  (I assume they

Characters allowed in symbols

2009-03-27 Thread ke...@ksvanhorn.com
The Clojure documentation, under "Reader", gives a list of characters allowed in a symbol name. The characters, <, >, and = are not included in this list. How is it then that <, <=, >, >=, =, etc. are symbols? (I assume they are symbols because I can write (< 3 4), etc.) --~--~-~--~---

Re: oo

2009-03-27 Thread Rich Hickey
On Fri, Mar 27, 2009 at 4:58 PM, mikel wrote: > > > > On Mar 27, 5:56 am, Konrad Hinsen wrote: >> On Mar 27, 2009, at 9:25, Mark Engelberg wrote: > >> > Considering how complex the situation can get with single dispatch, I >> > imagine it gets even more complex in multiple dispatch situations.

Re: PATCH: printing a ref with type metadata

2009-03-27 Thread srader
Thanks for the explanation and the patch. But instead of patching print-method, maybe vary-meta should be patched to handle refs? Scott On Mar 27, 7:07 am, Konrad Hinsen wrote: > On Mar 27, 2009, at 12:55, Konrad Hinsen wrote: > > > I'd say yes. Here's what happens: Typing "foo" at the REPL cau

Re: oo

2009-03-27 Thread mikel
On Mar 27, 5:56 am, Konrad Hinsen wrote: > On Mar 27, 2009, at 9:25, Mark Engelberg wrote: > > Considering how complex the situation can get with single dispatch, I > > imagine it gets even more complex in multiple dispatch situations.  In > > the multimethods example at clojure.org/multimetho

Scala vs Clojure

2009-03-27 Thread Jon Harrop
Can anyone who has tried both of these languages to a decent degree compare them in practical terms? In other words, I am not interested in the technical aspects of the languages themselves (e.g. dynamic vs static typing) but things like IDE support, tools (lexers and parsers), standard librar

Re: extra166y

2009-03-27 Thread Tom Hickey
Hi Jason, If you use the jsr166y from the files section of the group (http:// clojure.googlegroups.com/web/jsr166y.jar) you should be okay. I know this doesn't help with the exception you are getting, but it may get you moving forward. Cheers, Tom http://clojure-log.n01se.net/date/2009-01-31.ht

extra166y

2009-03-27 Thread Jason Baker
I'm attempting to run some functions in the parallel library. I've downloaded jsr166y and put it in my classpath. Apparently, all of the functions that the parallel library uses got split into another library called extra166y (and the namespace was changed as well). I figured that it would be a

Re: Are there ways to propagate bindings to child threads?

2009-03-27 Thread Paul Stadig
On Fri, Mar 27, 2009 at 10:06 AM, hjlee wrote: > > Hi, all. > > Story: > I couldn't understand my "binding" form behavior. > > (binding [*print-level* 2 *print-length* 2] (some-function)) > > but, some outputs didn't confirm the bound value. > > After some investigation on my code and output, I f

Clojure and swank on Android?

2009-03-27 Thread Marko Kocić
After some googling I found out that some people were able to run Clojure on Android phones. Did anyone tried to port swank to Android? It might seem like a good idea to start swank server on the phone, connnect with slime, and have good old live programming environment. Regards, Marko Kocić --

Re: Are there ways to propagate bindings to child threads?

2009-03-27 Thread Michael Wood
On Fri, Mar 27, 2009 at 4:06 PM, hjlee wrote: > > Hi, all. > > Story: > I couldn't understand my "binding" form behavior. > > (binding [*print-level* 2 *print-length* 2] (some-function)) > > but, some outputs didn't confirm the bound value. > > After some investigation on my code and output, I fo

children function for hierarchies

2009-03-27 Thread Stuart Sierra
I noticed that core doesn't have a "children" function for hierarchies, although it has "parents", "descendants", and "ancestors". Here's one: (defn children ([tag] (set (filter (fn [t] (contains? (parents t) tag)) (descendants tag ([h tag] (set (filter (fn [t

Re: Will Clojure work on AppEngine?

2009-03-27 Thread Robin B
Google will officially announce Java support for AppEngine at the end of May at Google IO: http://ru.ly/T6 Clojure web apps will have access to BigTable and be able to auto-scale based on load. Clojure in the cloud! Robin On Feb 2, 2:35 pm, Mark Derricutt wrote: > I wonder if the Classloader

Are there ways to propagate bindings to child threads?

2009-03-27 Thread hjlee
Hi, all. Story: I couldn't understand my "binding" form behavior. (binding [*print-level* 2 *print-length* 2] (some-function)) but, some outputs didn't confirm the bound value. After some investigation on my code and output, I found the reason. - I used pmap Well, I can use "set!", but I thi

PATCH: printing a ref with type metadata

2009-03-27 Thread Konrad Hinsen
On Mar 27, 2009, at 12:55, Konrad Hinsen wrote: > I'd say yes. Here's what happens: Typing "foo" at the REPL causes a > call to clojure.core/print-method. This is a multimethod that > dispatches on the result of clojure.core/type, which is the value of > the :type tag in the metadata if there is

questions about clojure.contrib.error-kit

2009-03-27 Thread Stuart Halloway
(1) Is there any reasonable way to attach handlers to lazy sequences such that the handlers will still be in place outside the original handler scope, when the sequence is finally evaluated? (It is not obvious to me how to do this without making the handler system part of the language core

Re: printing a ref with type metadata

2009-03-27 Thread Konrad Hinsen
On Mar 26, 2009, at 22:44, srader wrote: > When I type the following in at the REPL: > > (def foo (ref {} :meta {:type :t})) > > and then try to print it, I get the following error: > > java.lang.ClassCastException: clojure.lang.Ref (NO_SOURCE_FILE:0) > [Thrown class clojure.lang.Compiler$Compi

Re: oo

2009-03-27 Thread Laurent PETIT
2009/3/27 Konrad Hinsen > > On the other hand, I would definitely like to be able to implement > left-to-right precedence myself on top of Clojure's multimethods, and > it seems that at the moment this is not possible. Yes. And also the ability to redefine the method that tries to determine ca

printing a ref with type metadata

2009-03-27 Thread srader
Hi, When I type the following in at the REPL: (def foo (ref {} :meta {:type :t})) and then try to print it, I get the following error: java.lang.ClassCastException: clojure.lang.Ref (NO_SOURCE_FILE:0) [Thrown class clojure.lang.Compiler$CompilerException] Is this a bug? Thanks, Scott --~

Slime bug

2009-03-27 Thread Curran Kelleher
I think I found a bug in swank. When I execute in the SLIME REPL (loop [i 0] (when (< i 50) (println i) (recur (inc i it goes for a while (the last printed number varies greatly), then inevitably throws the exception below. This looks like a but in swank's output stream implementation. I

Re: oo

2009-03-27 Thread Konrad Hinsen
On Mar 27, 2009, at 9:25, Mark Engelberg wrote: > I think I've answered at least part of my own question. This is the > simplest ambiguous case I've found: > > ab > | | > -- > | > c Indeed. An ambiguous situation can occur whenever the type hierarchy graph is n

Re: oo

2009-03-27 Thread Mark Engelberg
I think I've answered at least part of my own question. This is the simplest ambiguous case I've found: ab | | -- | c user> (defmulti test-prefer :tag) #'user/test-prefer user> (defmethod test-prefer ::a [h] "a") # user> (defmethod test-prefer ::b [h] "b") # user

Re: oo

2009-03-27 Thread Mark Engelberg
I'm very interested in this thread. I'm having trouble figuring out exactly which situations require prefer-method and which do not. One thing that would help me understand the issues more deeply would be if someone could post the simplest possible multimethod that requires prefer-method to disa