Clojure

Support pretty printing namespace declarations under code-dispatch

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.2, Release 1.3
  • Fix Version/s: Release 1.5
  • Component/s: None
  • Labels:
  • Environment:
    all
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Currently when you print code with an (ns ) declaration in it, the ns declaration comes out kind of messy. This patch makes that beautiful.

Activity

Rich Hickey made changes -
Field Original Value New Value
Approval Vetted [ 10003 ]
Fix Version/s Backlog [ 10035 ]
Fix Version/s Release 1.5 [ 10150 ]
Stuart Sierra made changes -
Assignee Tom Faulhaber [ tomfaulhaber ] Stuart Sierra [ stuart.sierra ]
Hide
Stuart Sierra added a comment -

Screened.

It's not perfect, but an improvement.

Before the patch:

user=> (with-pprint-dispatch code-dispatch (pprint '(ns com.some-example.my-app (:require clojure.string [clojure.set :as set] [clojure.java.io :refer (file reader)]))))
(ns
  com.some-example.my-app
  (:require
    clojure.string
    [clojure.set :as set]
    [clojure.java.io :refer (file reader)]))
nil

After the patch:

user=> (with-pprint-dispatch code-dispatch (pprint '(ns com.some-example.my-app (:require clojure.string [clojure.set :as set] [clojure.java.io :refer (file reader)]))))
(ns com.some-example.my-app
  (:require clojure.string [clojure.set :as set]
            [clojure.java.io :refer (file reader)]))
nil
Show
Stuart Sierra added a comment - Screened. It's not perfect, but an improvement. Before the patch:
user=> (with-pprint-dispatch code-dispatch (pprint '(ns com.some-example.my-app (:require clojure.string [clojure.set :as set] [clojure.java.io :refer (file reader)]))))
(ns
  com.some-example.my-app
  (:require
    clojure.string
    [clojure.set :as set]
    [clojure.java.io :refer (file reader)]))
nil
After the patch:
user=> (with-pprint-dispatch code-dispatch (pprint '(ns com.some-example.my-app (:require clojure.string [clojure.set :as set] [clojure.java.io :refer (file reader)]))))
(ns com.some-example.my-app
  (:require clojure.string [clojure.set :as set]
            [clojure.java.io :refer (file reader)]))
nil
Stuart Sierra made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Stuart Sierra made changes -
Waiting On richhickey
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: