[CLJS-349] cljs.compiler: No defmethod for emit-constant clojure.lang.LazySeq Created: 30/Jul/12 Updated: 10/May/15
The cljs compiler errors when trying to emit-constant for a clojure.lang.LazySeq.
Example : https://www.refheap.com/paste/3901
Here syms is defined as a LazySeq on line 3, then on line 7 it is quoted. The error is included in the refheap.
Emitting a cljs.core.list for this type seems to solve the issue.
|Comment by David Nolen [ 31/Aug/12 9:27 AM ]|
Can you identify precisely where a LazySeq is getting emitted here? A LazySeq is not literal so this seems like a bug in the macro to me. I could be wrong. Thanks!
|Comment by Herwig Hochleitner [ 28/Oct/12 9:31 PM ]|
The lazy seq seems to be introduced on line 7, the '~syms form
Clojure allows lazy-seqs to be embedded: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L4538
As an aside: The relevant protocol is not literality, but the print-dup multimethod. Do / Should we have print-dup in CLJS?
|Comment by Herwig Hochleitner [ 31/Oct/12 10:10 PM ]|
Attached patch 0001 doesn't add a case for LazySeq, but folds two cases for PersistentList and Cons into one for ISeq.
|Comment by David Nolen [ 19/Nov/13 9:28 PM ]|
This approach seems acceptable but this is an old patch can we update for master?