Re: How to safely print structures that may contain infinite lazy seqs?

2020-11-02 Thread Austin Haas
Thanks, Juan. I don't need to know the length of the seq, though, only that it is lazy. I don't want to realize *any* lazy seqs. Ideally, I'd like to be able to print any data structure and have all lazy seqs print just like it does in the example I gave above (i.e.,

Re: Integrating `core.async` with `httpcore5-h2`

2020-11-02 Thread bartuka
Cool! Thanks for sharing, I was looking for a simple web-server prototype in order to study its internal. -- 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

Re: How to safely print structures that may contain infinite lazy seqs?

2020-11-02 Thread Justin Smith
> The next step might be to investigate why infinite lazy seqs don't print as > clojure.lang.LazySeq, like the finite ones. that printing of "clojure.lang.LazySeq@c5d38b66" relies on completely realizing the input, as it relies on the hash, which relies on the fully realized value On Mon, Nov

Re: How to safely print structures that may contain infinite lazy seqs?

2020-11-02 Thread Justin Smith
hit send too soon -- also, that print-method doesn't catch all lazy values user=> (instance? clojure.lang.LazySeq (range)) false user=> (supers (class (range))) #{java.lang.Iterable java.util.List clojure.lang.Obj clojure.lang.IPending java.io.Serializable clojure.lang.IHashEq

Re: How to safely print structures that may contain infinite lazy seqs?

2020-11-02 Thread Juan Monetta
Hi Austin, Since there is no way to know the length of a lazy-seq without realizing it, I think your only choice is to set a limit on it by binding *print-length* if you are not sure about the sequence. Other thing you can try is bounded-count like this : (defn looks-finite? [xs] (let

Re: Clojure and Data Science in Healthcare #1

2020-11-02 Thread Daniel Slutsky
Here is the meeting's video: https://youtu.be/dayMZjQcVaY Note that the text chat was quite lively -- see the link at the video description. Many thanks to Sivaram Arabandi and Pier Federico Gherardini for the talks, to Lacey Kitch who kept clarifying things at the text chat, and to João

Re: How to safely print structures that may contain infinite lazy seqs?

2020-11-02 Thread Austin Haas
Thanks, Justin! Yeah, I noticed that range doesn't return an instance of clojure.lang.LazySeq, so I added a print-method for clojure.lang.Iterate. And that one seems to work as expected, but apparently you can't override the print-method for clojure.lang.LazySeq. But this doesn't seem like a