Karsten Schmidt <i...@toxi.co.uk> writes: > Sinc the prefix map is built iteratively as part of the parsing I was > hoping to attach it as meta data to the returned lazy-seq, since I > can't see any other way of returning this map apart from attaching to > every single triple in the seq (which seems like overkill).
Well, a (lazy) seq has a value and a rest which is again a (lazy) seq. In your original code, you also added metadata to every seq the complete seq was built from, so it has been the very same overkill in principle. > Are there any other options I'm missing here? As you've said, you could add the prefix map to the triples. Or you could make you functions return tuples of the form [triple-seq prefix-map]. However, to build the complete prefix-map, you'd possibly need to parse everything, so the benefit of a lazy triple-seq is gone. So I think I'd just go with the approach of adding the prefix map to the triples. Since that's the very same map most of the time anyway, it's only adding one pointer per triple which is not so bad as it seems. Bye, Tassilo -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.