Kaz Kylheku
1/9/2015 6:51:00 PM
On 2015-01-09, luser droog <mijoryx@yahoo.com> wrote:
> For lisp-type languages, this would mean never having to
> count parens in order to close everything.
Historically, there existed in some Lisp dialects a "super bracket".
That is to say, you can have a hierarchy of parentheses with different powers.
We can illustrate this with two levels: the regular parentheses () and
the super parentheses []:
[defun foo (x)
(if (> x 1) "greater than one"]
The ] parenthesis closes all the open ( parentheses up to the previous matching
[ parenthesis. There is no counting of outstanding ( parentheses required on
the part of the coder.
Now you could make it so that you only have one kind of parenthesis, and the
language simply doesn't care about unbalanced parentheses. But that makes it
difficult to find errors in programs.
If you write a function and do not close it, then subsequent functions are
being defined inside that function. The source file then ends and there is no
diagnostic.