4 ms·
(defun main () (format t "Hello world") ) Should be (defun main () (format t "Hello world")) The lisp community has very well established for
by juki 6y ago
(defun main
()
(format t "Hello world")
)
Should be
(defun main ()
(format t "Hello world"))
The lisp community has very well established formatting conventions. You pretty much never see closing parens on their own line like this except when reading code written by beginners (or some special cases like package export lists for example, where one might want to leave the list "open" for adding new symbols, similar to a trailing comma in some other languages).
- tasuki 6y ago> The lisp community has very well established formatting conventions. You pretty much never see closing parens on their own line like this except when reading code written by beginners Why is that? Space efficiency? As an outsider, I find the "wrong" example more readable.
- lispm 6y agoOnce you use Lisp a bit, the parentheses fade away. It's like bicycle riding. As a beginner one thinks those supports wheels at the sides of the bicycle are absolutely necessary. One is constantly struggling to keep upright. Once you can ride a bike without them, one asks if they were ever necessary. Then one never thinks consciously about keeping balance.
- varjag 6y agoAs said in the sibling comment, it mostly fades away and you see the structure with indentation - very much how you would in Python.