[英]Why Clojure doesn't follow the most common indentation style in java code?
I was looking at java code in Clojure. 我在Clojure中查看java代码。 I found the indentation to be very strange to me.
我发现缩进对我来说很奇怪。
I'm pretty used to the indentation style by http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html#262 . 我已经习惯了http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html#262的缩进风格。 And most of the IDEs have configured auto-format in this way.
大多数IDE都以这种方式配置了自动格式化。 Why doesn't Clojure follow this style?
为什么Clojure不遵循这种风格?
UPDATE: 更新:
I meant the part of Clojure implemented in java eg https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ARef.java 我的意思是用java实现的Clojure部分,例如https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ARef.java
The code you are referring to uses the Whitesmiths style of brace indentation. 您所指的代码使用Whitesmiths样式的大括号缩进。
It is a matter of personal preference. 这是个人喜好的问题。 Nothing wrong with it, other than it is not very common.
没有什么不对,除了它不常见。
Why follow Java indentation style? 为什么要遵循Java缩进风格? Clojure follows Lisp.
Clojure跟随Lisp。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.