You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Personally when using namespaced maps i avoid giving a newline after the namespace.
I want put the namespace before the maps explicitly and my cider repl print it without giving newline.
But i still confused whether giving space between the namespace and maps or not.
;; no newline
#:my-ns{:k :v}
;; no newline with space
#:my-ns {:k :v}
I think it's like putting metadata notation from the guide.
;; good (from the guides)
(def ^:private a 5)
;; bad (just examples, not from the guide)
(def ^:private
a 5)
(def ^:private
a 5)
(def ^:private
a 5)
(def ^:private
a 5)
Maybe it need to be added to the guides after discussing it first of course. It will be a rule about using namespaced maps.
The possibilities are
;;from Looveh
#:user
{:username "foo"
:role :bar}
#:user
{:username "foo"
:role :bar}
#:user
{:username "foo"
:role :bar}
;; without newline
#:user{:username "foo"
:role :bar}
;; without newline but with space
#:user {:username "foo"
:role :bar}
;; sometimes i use this to if the maps are small
{:user/username "foo"
:user/role :bar}
What is the suggested level of indentation of multi-line namespaced maps?
The text was updated successfully, but these errors were encountered: