Re: Possible bug in with-symbol-macros, interacts badly with case

2010-09-13 Thread icemaze
I digged a little and I have a patch. I modified the case* parser in Compiler.java, so the patch shouldn't affect anything else: I prefer keeping safe since my knowledge of Clojure internals is limited, but a more radical solution might be desirable. The problem seems caused by the way case*

Possible bug in with-symbol-macros, interacts badly with case

2010-09-12 Thread icemaze
I wrote a test case: (use 'clojure.contrib.macro-utils) (defn bug? [] (with-symbol-macros (case 0 0 1))) The REPL prints: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.MapEntry (NO_SOURCE_FILE:4) Can anyone confirm this, please? -- You

Re: Possible bug in with-symbol-macros, interacts badly with case

2010-09-12 Thread icemaze
I found a workaround: (use 'clojure.contrib.macro-utils) (defsymbolmacro one 1) (defn bug1 []   (with-symbol-macros (bug2))) (defn bug2   (case 0     0 one))) The one symbol macro is there just to show that everything works as expected. -- You received this message because you are