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
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
(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
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
#
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
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)
>
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&