Parentheses

Parentheses

What Lispers seem to love, but others seem to hate.

Particularly C programmers, who are paradoxically often advised to 'parenthesize defensively' but see a language which does so by nature to be somehow distasteful.

The argument that programs with a mixture of parentheses and braces are easier for the programmer to format doesn't work: formatting can be done by editors with built-in prettyprinters such as Emacs.

There have been at least three attempts to get rid of the parentheses and move towards a more Algol-like notation: Lisp2, CGOL? and Dylan?. None of these has been particularly successful. This could be Lisp telling us something.

The parentheses are of course there so that program fragments can be treated as data, which is how macros work.

Attempts to reinvent the wheel include Curl, which has Lispish syntax but with braces in place of parentheses, and various languages with XML syntax such as Water.

And don't forget Python, which, while busily reinventing lisp in most respects, replaces parens with terrifyngly strict indentation rules.


Isn't it really about s-expressions? I certainly don't care if it is parentheses or squarebrackets or whathaveyounot. What I do care about is what s-expressions give me. Or perhaps, what they make so much easier for me to accomplish (manipulate code as data) compared to Python, et al.

After all, code is data. -- Erik Enge

[Well, one benefit of parentheses is that the left and right parentheses are more visually distinct from each other than (square) brackets, or braces, which are harder to tell apart in some fonts. --Sebastian Stern]


This page is linked from: Fear of Lisp  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively