eval doesn't mind lazy seqs as input:

user=> (map identity ['quote ()])
(quote ())
user=> (class (map identity ['quote ()]))
clojure.lang.LazySeq
user=> (eval (map identity ['quote ()]))
()

But it can't handle a form that contains an (evaluated) empty lazy
seq. Another example:
user=> (eval `(quote ~(range -1)))
CompilerException java.lang.UnsupportedOperationException: Unknown
Collection type, compiling:(NO_SOURCE_PATH:53)

I think Alan pointed to bug. The empty-expr needs to check for LazySeq
instances as well.

On Feb 14, 2:00 pm, Stuart Sierra <[email protected]> wrote:
> A sequence is equal to a list because Clojure defines = to compare similar
> collections by their contents. For example, the vector [1 2 3] is equal (by
> the = function) to the list (1 2 3).
>
> `eval` calls the Clojure compiler. The compiler operates on lists returned
> by the reader, so I would not expect it to work on lazy sequences.
>
> -S

-- 
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