3 ms·
I would appreciate a little bit more detail here so that the article can be corrected. Could you point to which dangling parens need to be fixed?
by wheresvic4 6y ago
I would appreciate a little bit more detail here so that the article can be corrected. Could you point to which dangling parens need to be fixed?
- 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.
- varjag 6y agoDangling parens are the loose closing parens on separate lines. I.e. this: (defun plus (x y) (+ x y) ) instead of this: (defun plus (x y) (+ x y)) It suggests the author tires to balance parens manually/visually rather than using a proper editor mode. An understandable and common mistake of a newbie, but looks bad when you are writing a tutorial.
- wheresvic4 6y agoThanks, noted. Fixed now!