Last active
November 12, 2019 10:46
-
-
Save stuartsierra/f2db3748424f08346474a08630720998 to your computer and use it in GitHub Desktop.
Demonstration of pair-wise indentation for Clojure syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Demonstration of pair-wise indentation for Clojure syntax | |
(let [local-symbol-one | |
(expression-to-compute-symbol-one) | |
local-symbol-two | |
(expression-to-compute-symbol-two)] | |
(body-expressions)) | |
(def a-map | |
{:com.example.application/one | |
"Value number one, the first of its kind." | |
:com.example.applicaton/two | |
"Value number two, how do you do?"}) | |
(cond | |
(test-expression-one) | |
(result-expression-one) | |
(test-expression-two) | |
(result-expression-two) | |
(test-expression-three) | |
(result-expression-three) | |
:else | |
(else-result-expression)) | |
(case test-value | |
:value-one | |
(result-expression-one) | |
:value-two | |
(result-expression-two) | |
:value-three | |
(result-expression-three) | |
(else-result-expression)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks very clean.
But what about destructuring in let block? Say:
Parinfer will formate automatically and break it:
Not sure if there's any config to tune the behaviour.