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

jagged printing in emacs #320

Open
timsgardner opened this issue Nov 13, 2018 · 1 comment
Open

jagged printing in emacs #320

timsgardner opened this issue Nov 13, 2018 · 1 comment
Labels

Comments

@timsgardner
Copy link
Contributor

timsgardner commented Nov 13, 2018

Functions that involve multiple calls to print, println, (.Write ^TextWriter w "bla"), etc – basically anything that writes to *out* in multiple steps – are prone to print to the emacs repl in a garbled form, with newlines inserted and removed seemingly at random. This makes data almost unreadable. For example, the following:

(pprint
  (let [f (fn f [i]
            (if (<= i 0)
              :leaf
              (vec
                (repeatedly 3
                  #(f (dec i))))))]
    (f 4)))

prints as:

[[
[[:leaf :leaf
 :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf
 :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]]
 [[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  
[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]]
 
[[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]
]
  [[:leaf :leaf
 :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  
[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]]]

In Nostrand it evidently prints as

[[[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]]
 [[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]]
 [[[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]
  [[:leaf :leaf :leaf] [:leaf :leaf :leaf] [:leaf :leaf :leaf]]]]

Among other things, this could be:

  • something about the repl
  • something about the repl protocol
  • something about inf-clojure
  • something about the port we're listening on

This is a fairly major issue because it makes complex data unreadable.

@timsgardner timsgardner added this to the Beta Release milestone Nov 13, 2018
@timsgardner timsgardner removed this from the Beta Release milestone Dec 4, 2018
@saikyun
Copy link
Contributor

saikyun commented Dec 27, 2018

Does the same thing happen if you use the standard read function? It seems similar to the issue where the repl gets stuck, which doesn't happen when you use the standard read function (as described in #292).

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

No branches or pull requests

2 participants