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
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
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
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
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
--~
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
(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
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
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
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
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
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
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
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ć
--
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
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
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
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
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
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
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.
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.)
--~--~-~--~---
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
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
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
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
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
27 matches
Mail list logo