相关疑难解决方法(0)

为什么习惯上在基于Lisp的语言中将许多右括号放在一行上?

通常代码如下所示:

(one-thing
    (another-thing arg1 (f arg5 r))
    (another-thing arg1 (f arg5 r)))
Run Code Online (Sandbox Code Playgroud)

为什么不喜欢这个?:

(one-thing
    (another-thing arg1 (f arg5 r))
    (another-thing arg1 (f arg5 r))
)
Run Code Online (Sandbox Code Playgroud)

它允许更容易地添加和删除"另一个东西"行(不删除和重新添加尾部右括号).你也可以对那个单独的右括号(例如";循环结束")发表一些评论.

当我使用第二种风格的代码与使用第一种风格的现有代码混合时有多糟糕?

lisp coding-style clojure parentheses

35
推荐指数
3
解决办法
3727
查看次数

标签 统计

clojure ×1

coding-style ×1

lisp ×1

parentheses ×1