Re: Unsupported binding form

2009-09-08 Thread Gorsal
Dang. I did indeed have to read the fine print. Sequences vs. lists. All look the same , don't they. Those macroexpanded things which looked like lists were actually sequences. This is because map and mapcat and such return ... sequences! (list? seq) returns false on a sequence... So. (defn mkseq

Re: Unsupported binding form

2009-09-08 Thread Laurent PETIT
Without digging into the implementation code: shouldn't the expansion for e.g. clojure.core/letfn return a vector and not a list for the binding ? ((G__1840 [a b c] (print a))) should be (vector (G__1840 [a b c] (print a))) or [(G__1840 [a b c] (print a))] ? Maybe clojure.core/letfn is currentl

Re: Unsupported binding form

2009-09-08 Thread Gorsal
(set! *print-level* 8) ;;so you can see all of macroexpand-1 ;;MISC Utilities ;; ;; (defn mklst [item] (if (list? item) item (list item))) (defn lassoc [item lst] (first (filter #(= (first (mklst %)) item) lst))) (defmacro llet [bind & body] `(let ~(vec (mapcat #(if-no

Re: Unsupported binding form

2009-09-08 Thread Laurent PETIT
What's your current condlet definition ? 2009/9/8 Gorsal > > # (G__1852 2) (NO_SOURCE_FILE:1182)> > So, I'm porting Paul Grahm's condlet macro to clojure. I've done it > except when i evaluate it it gives me the above error. However, when I > macroexpand-1 it it evaluates fine. > > The only diff

Unsupported binding form

2009-09-08 Thread Gorsal
# So, I'm porting Paul Grahm's condlet macro to clojure. I've done it except when i evaluate it it gives me the above error. However, when I macroexpand-1 it it evaluates fine. The only difference between evaluating the macroexpansion vs the other way is that the (gensym) vars are now regular var

Re: unsupported binding form for cond-let

2008-12-05 Thread Stephen C. Gilardi
On Dec 5, 2008, at 1:33 PM, Brian Doyle wrote: > I started to play with cond-let in the contrib.cond package and got an > unexpected error: > > user=> (cond-let [x (zero? 0)] (println "hello world")) > java.lang.Exception: Unsupported binding form: (zero? 0) >

unsupported binding form for cond-let

2008-12-05 Thread Brian Doyle
I started to play with cond-let in the contrib.cond package and got an unexpected error: user=> (cond-let [x (zero? 0)] (println "hello world")) java.lang.Exception: Unsupported binding form: (zero? 0) (NO_SOURCE_FILE:11) user=> (cond-let x (zero? 0) (println "hello world&