Shouldn't that be (.-length nl) ?
Matt
On Tuesday, January 10, 2012 7:25:29 AM UTC+10, Jozef Wagner wrote:
>
> Beware that NodeList is often a live collection, so it is probably a good
> idea to produce "eager" seq. I use this to convert it to seq:
>
> (defn nodelist-to-seq
> "Converts nodelis
I've created an issue about this.
http://dev.clojure.org/jira/browse/CLJS-120
Thanks.
On Jan 10, 5:31 am, Stuart Sierra wrote:
> I would like to have NodeList be seqable. Please file a ticket with a
> patch. Perhaps someone else can shed light on why Opera doesn't work.
> -S
--
You received th
Beware that NodeList is often a live collection, so it is probably a good
idea to produce "eager" seq. I use this to convert it to seq:
(defn nodelist-to-seq
"Converts nodelist to (not lazy) seq."
[nl]
(let [result-seq (map #(.item nl %) (range (.length nl)))]
(doall result-seq)))
--
I would like to have NodeList be seqable. Please file a ticket with a
patch. Perhaps someone else can shed light on why Opera doesn't work.
-S
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.c
Hi,
Following code cause an error, because NodeList doesn't extend
ISeqable.
(doseq [u (goog.dom/getElementsByClass "myclass")]
...)
Uncaught Error: No protocol method ISeqable.-seq defined for type
object: [object NodeList]
So I implemented ISeqable for NodeList.
(extend-type js/NodeList