If this is a bug, it's in eval, not in map. eval apparently just
doesn't like to be handed lazy sequences, or something:

repl-1=> (eval `(quote ~(lazy-seq nil)))
CompilerException java.lang.UnsupportedOperationException: Unknown
Collection type, compiling:(NO_SOURCE_PATH:14)

;; just to demonstrate that these are the same value:
repl-1=> (= `(quote ~(lazy-seq nil))
repl-1=*    `'~(map identity ()))
true

This looks like it's caused by
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2680
- it should probably be testing for ISeq, not IPersistentList.

On Feb 13, 1:02 am, Eric Fong <[email protected]> wrote:
> => (eval `'~(map identity [1 2 3]))
> (1 2 3)
>
> => (eval `'~(map identity ()))
> CompilerException java.lang.UnsupportedOperationException: Unknown
> Collection type, compiling:(NO_SOURCE_PATH:135)
>
> => (eval `'~(map identity nil))
> CompilerException java.lang.UnsupportedOperationException: Unknown
> Collection type, compiling:(NO_SOURCE_PATH:138)
>
> try the above in repl, clojure 1.3, why the exception occured?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to