Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspector - Cons it not printed like other sequentials? #268

Open
vemv opened this issue May 7, 2024 · 2 comments
Open

Inspector - Cons it not printed like other sequentials? #268

vemv opened this issue May 7, 2024 · 2 comments

Comments

@vemv
Copy link
Member

vemv commented May 7, 2024

Below there's an inspected Atom of Cons, the problem being that all its 3 items are rendered into the same line:

Class: clojure.lang.Atom

--- Deref:
  Class: clojure.lang.Cons

  --- Contents:
    ({:instant Wed May 08 00:18:29 CEST 2024, :level :error, :file "xxx_api/middleware.clj", :ns "xxx-api.middleware", :line 118, ...} {:RESULT 42} {:D 42})

I'm fairly sure that in the past it was one line per item.

Thoughts? @alexander-yakushev

@vemv vemv added the inspector label May 7, 2024
@vemv
Copy link
Member Author

vemv commented May 7, 2024

False alarm - if I go down, I see the usual structure

Class: clojure.lang.Cons

--- Contents:
  0. {:instant Wed May 08 00:18:29 CEST 2024, :level :error, :file "xxx/middleware.clj", :ns "xxx-api.middleware", :line 118, ...}
  1. {:RESULT 42}
  2. {:D 42}

...The thing that threw me off is that in the previous screen, output was pretty long.

Would there be a drawback to render the same data in "0. 1. 2." format while inspecting the atom?

It's a bit redundant (since then two screens would have nearly the same content) but on the other hand, we keep things readable at all times.

@alexander-yakushev
Copy link
Member

alexander-yakushev commented May 13, 2024

This happens because Cons does not implement clojure.lang.Counted, so the inspector does not know its length ahead of time and resorts to printing it the "safe way" instead of expanding it.

It is possible to always try to get one page worth of items even for uncounted collections. That would require some rewriting though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants