Open masmatsum opened 2 years ago
Hi, I think that the current examples in the doc is not very good for us (cljstyle newbies) to understand the rule.
[:inner 1]
{foo [[:inner 1]]}
Current example
(foo bar baz (bang quz qoz))
seems wrong, since this is actually formatted as below:
;; === :indents {foo [[:inner 1]]} === (foo bar baz (bang quz qoz))
Also, when :list-indent is default value (2), cljstyle formats the bang form the same as above, even in the absence of the rule foo [[:inner 1]].
:list-indent
2
bang
foo [[:inner 1]]
Compare these 2 formatted codes:
;; === :indentation {:list-indent 2, :indents {}} === (foo bar baz (bang quz qoz))
;; === :indentation {:list-indent 2, :indents {foo [[:inner 1]]}} === (foo bar baz (bang quz qoz))
The indentations of these 2 codes are completely same. So I think this example is not very good to understand [:inner 1].
I suggest a slightly different example:
Here, the bang forms are differently indented, so this is easy to understand the effect of [:inner 1].
[:inner 0]
{foo [[:inner 0]]}
(foo bar baz bang)
is okay, but it is a little difficult to understand what 0 (:inner's parameter) means.
0
:inner
The suggested example above can also be used to explain {foo [[:inner 0]]}.
;; === :indentation {:list-indent 2, :indents {foo [[:inner 0]]}} === (foo bar baz (bang quz qoz))
This helps us understand the difference between {foo [[:inner 0]]} and {foo [[:inner 1]]}. Please consider it.
Hi, I think that the current examples in the doc is not very good for us (cljstyle newbies) to understand the rule.
1.
[:inner 1]
examplesCurrent examples and problem
Current example
seems wrong, since this is actually formatted as below:
Also, when
:list-indent
is default value (2
), cljstyle formats thebang
form the same as above, even in the absence of the rulefoo [[:inner 1]]
.Compare these 2 formatted codes:
The indentations of these 2 codes are completely same. So I think this example is not very good to understand
[:inner 1]
.Suggestion
I suggest a slightly different example:
Here, the
bang
forms are differently indented, so this is easy to understand the effect of[:inner 1]
.2.
[:inner 0]
examplesCurrent examples and problem
Current example
is okay, but it is a little difficult to understand what
0
(:inner
's parameter) means.Suggestion
The suggested example above can also be used to explain
{foo [[:inner 0]]}
.This helps us understand the difference between
{foo [[:inner 0]]}
and{foo [[:inner 1]]}
. Please consider it.Environment