cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Tagged literals printed incorrectly, space removed

Open timothypratley opened this issue 7 months ago • 3 comments

Cursive prints tagged literals without a space between the tag and the literal. This is usually fine, except when the literal is a symbol.

From a REPL in Cursive:

(tagged-literal 'foo 'bar)
=> #foobar

This is invalid and unreadable.

From a command line REPL:

user=> (tagged-literal 'foo 'bar)
#foo bar

It seems as though Cursive is processing the tagged literal and removing the space (possibly related to flare detection?)

I know what you are thinking... tagged literals on symbols?

There is a popular library that improves Clojure printing output (among other features) called clojure-plus by @tonsky https://github.com/tonsky/clojure-plus.

(require 'clojure+.print)
(clojure+.print/install!)

inc
=> #fnclojure.core/inc

The idea is great, it improves the output significantly... but in Cursive the space removal makes it both annoying and breaks the write/read symmetry.

timothypratley avatar May 16 '25 20:05 timothypratley

Also, the inline rendered version omits the function name in some cases:

Image

but at the REPL looks like this:

default-print-method => #fn clojure.plus.print.objects.objects-and-protocols/eval53529/fn--53530

Notice that there are 2 slashes in the symbol, which is not allowed. That's a bug in clojure-plus, not Cursive and probably the cause of that problem.

timothypratley avatar May 18 '25 16:05 timothypratley

Related: Image

Here I create an invalid symbol (it contains multiple slashes) and Cursive can display it in the REPL, but not in the inline results.

timothypratley avatar May 19 '25 17:05 timothypratley

Fix released in 2025.2-eap1 on 2025-05-22.

cursive-ghost avatar May 22 '25 03:05 cursive-ghost

thank you!

timothypratley avatar Sep 09 '25 04:09 timothypratley

Fix released in 2025.2 on 2025-08-04.

cmf avatar Nov 06 '25 05:11 cmf