Racket(lisp 编程语言)中的 [ ] 和 ( ) 括号有什么区别?

What is the difference between [ ] and ( ) brackets in Racket (lisp programming language)?

在我看来,从技术上讲两者可以互换,但具有不同的常规含义。

According to the Racket documentation,没有区别——只有一个约定,[] 用于 cond 子句(其余的请自行判断, 据我了解):

The use of square brackets for cond clauses is a convention. In Racket, parentheses and square brackets are actually interchangeable, as long as ( is matched with ) and [ is matched with ]. Using square brackets in a few key places makes Racket code even more readable.

在对 Racket 语言的设计一无所知的情况下,我的猜测是方括号的引入是为了回应抱怨许多 Lisp 表达式由于大量看起来相同的括号而难以阅读,特别是在深层嵌套结构的末端。换句话说,它可能用于让您的眼睛轻松地在代码中建立一些参考点,以确定您在任何给定点关闭的括号。