So the problem is that in clojure.pprint/pprint-let
the pprint-logical-block
wraps both branches while it shouldn't since pprint-simple-code-list
already generate parenthesis.
Adding a patch here :
From 1761194420c8befe62a6e12cabfd4483b645b703 Mon Sep 17 00:00:00 2001
From: Juan Monetta <jpmonettas@gmail.com>
Date: Fri, 10 Nov 2023 11:19:02 -0300
Subject: [PATCH] Fix clojure.pprint pprint-let when form doesn't contain
bindings
---
src/clj/clojure/pprint/dispatch.clj | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/clj/clojure/pprint/dispatch.clj b/src/clj/clojure/pprint/dispatch.clj
index 965c0b25..cd1c2b29 100644
--- a/src/clj/clojure/pprint/dispatch.clj
+++ b/src/clj/clojure/pprint/dispatch.clj
@@ -335,13 +335,14 @@
(defn- pprint-let [alis]
(let [base-sym (first alis)]
- (pprint-logical-block :prefix "(" :suffix ")"
- (if (and (next alis) (vector? (second alis)))
- (do
- ((formatter-out "~w ~1I~@_") base-sym)
- (pprint-binding-form (second alis))
- ((formatter-out " ~_~{~w~^ ~_~}") (next (rest alis))))
- (pprint-simple-code-list alis)))))
+ (if (and (next alis) (vector? (second alis)))
+ (pprint-logical-block
+ :prefix "(" :suffix ")"
+ (do
+ ((formatter-out "~w ~1I~@_") base-sym)
+ (pprint-binding-form (second alis))
+ ((formatter-out " ~_~{~w~^ ~_~}") (next (rest alis)))))
+ (pprint-simple-code-list alis))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--